Help with inline lists for horizontal navigation
I'm working on an update to my site header using no tables and lists for the navigation. It renders great in both IE 6 and Opera, but breaks in Firefox.
Here is a link to the test page: http://old.bigblueball.com/v3/test.htm
and the CSS file: http://old.bigblueball.com/v3/default.css
In Firefox, the for the advertisement is 10 pixels to tall and wide, and the second row of navigation links are positioned about 10 pixels too low.
I'm stumped as to why. I've used absolute positioning and specified the size for both of those elements, and as I said, they render perfectly in both IE and Opera.
Any CSS experts here care to point me in the right direction?
BigBlueBall
Junior Poster in Training
54 posts since Dec 2004
Reputation Points: 10
Solved Threads: 1
Thanks Dave. It all validates now, but the problem persists. It appears that the problem is the "broken box model" used by IE, where padding and borders are inside the DIV boundaries rather than outside.
I used a nested DIV for the banner to add the 4px padding, and now that is properly rendering in all Firefox, IE and Opera.
But I'm still stumped on the second navigation line. It displays properly in both IE and Opera, but still too low in Firefox. Here is the snippet from the CSS:
#nav-one {
position: absolute;
left: 97px;
top: 101px;
padding-top: 4px;
}
#nav-one ul {
list-style: none;
margin: 0;
padding: 0;
}
#nav-one li, p {
display: inline;
font-size: 90%;
font-weight: bold;
padding-left: 10px;
}
#nav-one a {color: #FFFFFF; text-decoration: none; }
#nav-one a:hover {color: #FFFFFF; text-decoration: underline;}
#nav-two {
position: absolute;
left: 57px;
top: 130px;
height: 18px;
}
#nav-two ul {
list-style: none;
}
#nav-two li {
display: inline;
font-size: 90%;
padding-left: 10px;
}
#nav-two a {color: #000000; text-decoration: none; }
#nav-two a:hover {color: #31329C; text-decoration: underline;}
nav-two is the second line of the navigation.
BigBlueBall
Junior Poster in Training
54 posts since Dec 2004
Reputation Points: 10
Solved Threads: 1
UPDATE:
It's all fixed now.
I had to add the margin and padding as follows:
#nav-two ul {
list-style: none;
<strong>margin: 0;</strong>
<strong>padding: 0;</strong>
}
Thanks again for your advice.
BigBlueBall
Junior Poster in Training
54 posts since Dec 2004
Reputation Points: 10
Solved Threads: 1
One problem is that IE and FF render surrounding styles (margin, border, padding) differently with respect to defined sizes (width, height). FF puts the surrounding styles outside the defined sizes. IE crams them inside.
The trick is to nest two tags, one with surrounding styles, and one with defined sizes.
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182