tags:

views:

22

answers:

2

I have a simple setup like so..

ul { list-style: none; }

    #navigation ul li a {
    padding: 0px 15px 0px 15px;
    line-height: 32px;
    float: left;
    color: #dedede;
    font-weight: bold;
}

And then a list.

<div id="navigation">
   <ul>
      <li><a href="#">etc</a></li>
      <li><a href="#">etc</a></li>
      <li><a href="#">etc</a></li>
      <li><a href="#">etc</a></li>
      <li><a href="#">etc</a></li>
   </ul>
</div>

The intention? The list items should render, side by side, in a straight line. Hunky dory in FireFox, IE8, Chrome, and Opera.

IE7 (and 6, too) displays them in a jagged stair-style, though. Any ideas?

+1  A: 

For IE you will need to add display: inline; for the li tag.

So:

* #navigation ul li { display: inline; } 
Marcin
Thank you. Though it still ignores the box-model that the other browsers follow; Any ideas on how to fix this?
Stacey
This is why web designers hate IE, IE uses a box model that is a little different. I'm testing it in IE7 at the moment and it looks the same as it does in firefox 3.6 (with that code at least). Is there something I'm misunderstanding, or do you have more css to go with that?
Marcin
Yeah, there is CSS around it, but way too much for this simple question. I'll see if I can hunt it down. It does work fine in IE8 though.
Stacey
Here is a page that talks about it. The area named "a workaround is possible" may help you arrive at a solution.http://stuffthathappens.com/blog/2007/09/12/ie-and-the-css-box-model-wronger-than-wrong/
Marcin
A: 

You want to have the float on the li elements, not on the a elements. Here's the updated CSS:

#navigation ul li {
    float: left;
}

#navigation ul li a {
    padding: 0px 15px 0px 15px;
    line-height: 32px;
    color: #dedede;
    font-weight: bold;
}
BalusC