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 7771979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:46:46+00:00 2026-06-01T16:46:46+00:00

Why does the following markup produce a space after each <li></li> , when there

  • 0

Why does the following markup produce a space after each <li></li>, when there are no spaces in the source? If I put them all on one line, the spaces disappear when previewing the page. But why is the browser reading my tabs as spaces?

(You can see a border next to services on the left in the first image. Between that border and services is the space. It’s not there in image 2.)

enter image description here

<nav>
    <ul>
        <li><a href="#" class="active">HOME</a></li>
        <li><a href="#">SERVICES</a></li>
        <li><a href="#">PRODUCTS</a></li>
        <li><a href="#">ABOUT</a></li>
        <li><a href="#">CONTACT</a></li>
        <li><a href="#">LIKE US</a></li>
    </ul>
</nav>

Here it is with all tabs removed:

enter image description here

<nav>
    <ul>
        <li><a href="#" class="active">HOME</a></li><li><a href="#">SERVICES</a></li><li><a href="#">PRODUCTS</a></li><li><a href="#">ABOUT</a></li><li><a href="#">CONTACT</a></li><li><a href="#">LIKE US</a></li>
    </ul>
</nav>

EDIT:

Browser is Safari 5.1.5 on OSX Lion. Editor is Espresso. Also tried TextMate. And this is the CSS for the nav.

nav {
    position: relative;
    width: 960px;
    padding: 0 30px;
    background: #281601; /* Old browsers */
    background: -moz-linear-gradient(left,  #3f2c16 0%, #281601 5%, #281601 95%, #3f2c16 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, right top, color-stop(0%,#3f2c16), color-stop(5%,#281601), color-stop(95%,#281601), color-stop(100%,#3f2c16)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(left,  #3f2c16 0%,#281601 5%,#281601 95%,#3f2c16 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(left,  #3f2c16 0%,#281601 5%,#281601 95%,#3f2c16 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(left,  #3f2c16 0%,#281601 5%,#281601 95%,#3f2c16 100%); /* IE10+ */
    background: linear-gradient(left,  #3f2c16 0%,#281601 5%,#281601 95%,#3f2c16 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3f2c16', endColorstr='#3f2c16',GradientType=1 ); /* IE6-9 */
    font-family: 'Crimson Text', serif;
    color: #fff;
}

nav:before {
    position: absolute;
    left: -12px;
    top: 0px;
    content: url('../img/nav-left.png');
}

nav:after {
    position: absolute;
    left: 960px;
    top: 0px;
    content: url('../img/nav-right.png');
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    display: inline-block;
}

nav ul li a, nav ul li a:visited {
    display: block;
    color: #c7beb4;
    text-decoration: none;
    font-size: 95%;
    letter-spacing: 0.08em;
    padding: 12px 20px;
    border-right: 1px solid #3b2b18;
}

nav ul li:first-child a:before {
    content: url('../img/nav-icon-home.png');
    margin: 0px 8px 0 0;
}

nav ul li:first-child a:hover:before {
    content: url('../img/nav-icon-home-active.png');
}

nav ul li:last-child {
    float: right;
}

nav ul li:last-child a {
    border:none;
}

nav ul li:last-child a:before {
    content: url('../img/nav-icon-facebook.png');
    margin: 0px 8px 0 0;
}

nav ul li:last-child a:hover:before {
    content: url('../img/nav-icon-facebook-active.png');
}

nav ul li a:hover {
    background: #c7beb4;
    color: #281601;
    box-shadow: inset 0 0 15px rgba(40,22,1,0.5);
}
  • 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-01T16:46:47+00:00Added an answer on June 1, 2026 at 4:46 pm

    Changed li’s display to display:table-cell instead of display:inline-block.

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

Sidebar

Related Questions

IS there any tool that does the following, given a url? strip everything (all
Does anyone know of a solution to the following markup validation error? I'm not
Placing the following code inside the 'markup' section on a web form does not
I'm getting crazy with this IE 7... ==> hhttp://neu.emergent-innovation.com/ Why does following function not
I have a file transfer program. The program (Client) does following operations to send
does the following integer arithmetic property hold? (m/n)/l == m/(n*l) At first I thought
Does the following code will increase the allocated memory continuously as it is called
The following does not compile, and I cannot for the life of me see
The following does not compile: class Foo { public: Foo( boost::shared_ptr< Bar > arg
Why does the following: class A(object): def __init__(self, var=[]): self._var = var print 'var

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.