Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6924165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:37:42+00:00 2026-05-27T10:37:42+00:00

I want to change my css for a nav bar that currently uses the

  • 0

I want to change my css for a nav bar that currently uses the last-child selector to using the first-child to cover up a padding gap and therefore make it more cross-browser compliant. I know I should switch the coding around to change the first one instead of the last one but the problem is that the absolute positioning currently holds the position to the left, leaving the gap to the right. Any ideas?

#navigation {font:1.6em Verdana,Geneva,sans-serif; position:absolute; top:103px;}

#navigation ul {list-style:none;}

#navigation span{ position:absolute; left:-15px; top:5px; width:15px; height:100%;    
background-color:#647484; background-image:url(images/navshadow.png); background-  
position:right top; background-repeat:repeat-y}

ul.dropdown li{z-index:3; font-weight:normal; float:left; zoom:1; background:#647484; 
padding:12px 16px; position:relative;}

ul.dropdown li:last-child{padding-right:20px;}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:37:42+00:00Added an answer on May 27, 2026 at 10:37 am

    Add position: relative to the #wrapper div and change the ul.dropdown style to the following:

    ul.dropdown {
        font: 1.6em Verdana, Geneva, sans-serif;
        position: absolute;
        top: 77px;                  /*this has changed*/
        list-style: none;
        background-color: #647484;  /*add this */
        left: 0;                    /*add this */
        right: 0;                   /*add this */
    }
    

    For a cleaner code, you may now want to remove the background colours from the child li elements.

    JSFiddle: http://jsfiddle.net/zyKDf/4/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to change background-size using css: I want 100 heights and 100 widths,
I have a navigation bar/list that is using only HTML and CSS. The background
I want to change css class of an element on certain event in jquery.
I have a nav bar with a drop down that is working beautifully. The
I want to convert CSS to SCSS that looks like this: .top { margin-top:
I want to have a nav bar set position: fixed to the top of
I am currently using the following as my external print.css file: /* Remove unwanted
For a current project I'm doing I'm using PHP includes for my nav bar
I want to change the used CSS File ( <link href=... /> ) dynamically
hey there i want to change some css attributes from javascript but i cant

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.