My fluid-width single line horizontal navbar problem!
-
I’ve almost got my new project ready to go, but one of the things I just can’t seem to wrangle is the navbar.
At the moment it’s float:left, but what I’m after is for it to fill all but 30px on either side of the screen. Try as I might I can’t get this working.
As soon as I specify a percentage instead of pixel value in the horizontal padding it pushes each button on the bar into it’s own line, where it perfectly takes up the space. I want to force it to do that, but all stay on one line. Is that possible?
Here’s the code in question:
#menu1 { height:1%; margin-left:30px; margin-right:30px; overflow:hidden; } #menu1 ul { margin:0; padding:0; } #menu1 ul li { display:inline; float:left; margin:0; padding:0; } #menu1 ul li a { display:block; padding:3px 20px; text-decoration:none; }
When I change the padding from 20px to a percentage it works up to a certain percent, then splits each one onto it’s own line and fills the screen perfectly.
- The topic ‘My fluid-width single line horizontal navbar problem!’ is closed to new replies.