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

  • SEARCH
  • Home
  • 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 8371243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:07:06+00:00 2026-06-09T14:07:06+00:00

I have a nav-menu on which it seems that I can’t add a space

  • 0

I have a nav-menu on which it seems that I can’t add a space (margin: 3px;) between the <li> elements.

You can see the HTML and CSS code on this jsfiddle or below.

You will see that I’ve added a border-bottom: 2px solid #fff; to the #access li to simulate the space between elements, but that is not going to work because under the nav-menu I will have a bunch of different colors. If I add margin-button: 2px it doesn’t work.

This is the HTML:

<nav id="access" role="navigation">
    <div class="menu-header-menu-container">
        <ul id="menu-header-menu" class="menu">
            <li id="menu-item-41" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-41">
                <a href="http://localhost:8888/fullstream/?page_id=5">About Us</a>
            </li>
            <li id="menu-item-35" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-35">
                <a href="http://localhost:8888/fullstream/?page_id=7">Services</a>
            </li>
            <li id="menu-item-34" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-34">
                <a href="http://localhost:8888/fullstream/?page_id=9">Environmental Surface Cleaning</a>
            </li>
            <li id="menu-item-33" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-33">
                <a href="http://localhost:8888/fullstream/?page_id=11">Regulations</a>
            </li>
            <li id="menu-item-32" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-32">
                <a href="http://localhost:8888/fullstream/?page_id=13">Contact Us</a>
            </li>
       </ul>
</div>

This is the CSS:

#access {
    background: #0f84e8; /* Show a solid color for older browsers */
    display: block;
    margin: 0 auto 6px 55px;
    position: absolute;
    top: 100px;
    z-index: 9999;
}
#access ul {
    font-size: 13px;
    list-style: none;
    margin: 0 0 0 -0.8125em;
    padding-left: 0;
}
#access li {
    position: relative;
    padding-left: 11px;
}
#access a {
    border-bottom: 2px solid #fff;
    color: #eee;
    display: block;
    line-height: 3.333em;
    padding: 0 10px 0 20px;
    text-decoration: none;
}

#access li:hover > a,
#access ul ul :hover > a,
#access a:focus {
    background: #efefef;
}
#access li:hover > a,
#access a:focus {
    background: #f9f9f9; /* Show a solid color for older browsers */
    background: -moz-linear-gradient(#f9f9f9, #e5e5e5);
    background: -o-linear-gradient(#f9f9f9, #e5e5e5);
    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f9f9f9), to(#e5e5e5)); /* Older webkit syntax */
    background: -webkit-linear-gradient(#f9f9f9, #e5e5e5);
    color: #373737;
}
#access ul li:hover > ul {
    display: block;
}
  • 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-06-09T14:07:07+00:00Added an answer on June 9, 2026 at 2:07 pm

    UPDATE 2021

    My original answer was from 2012 when many of the Level 3 CSS Selectors did not exist. To achieve this we would need JS or other explicit CSS styles/classes to achieve it. As @AlphaX has pointed out the best solution now is simply

    li.menu-item:not(:last-child) { 
       margin-bottom: 3px;  
    }
    

    OLD ANSWER

    add:

    margin: 0 0 3px 0;
    

    to your #access li and move

    background: #0f84e8; /* Show a solid color for older browsers */
    

    to the #access a and take out the border-bottom. Then it will work

    Here: http://jsfiddle.net/bpmKW/4/

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

Sidebar

Related Questions

I have got a submenu which expands from a nav menu type object when
I have a menu item that which I've created using display:table-cell; to ensure that
I have a nav menu for which I want to use a lava lamp
I have a nav menu which is a series of divs, alternately a div
Ok, very very weird issue here. I have a sub nav menu that links
I have a menu set up this way: <div id='top-navigation'> <ul> <li><a class='top-nav-button-unclicked' href='#'>SUBJECT</a></li>
I have nav buttons on this site: http://www.dermatologypartners.com which have rounded corners, a gradient,
I have a nav that has subnavs. When the user hovers over the li's
I have an image nav but the client wants to add a video icon
I have a menu with links in the following form, in which I am

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.