Ok, heres the thing. I know how to style an Unordered List into a horizontal nav. The problem I'm having is with the nav spanning 100% of the screen in a liquid layout.
Here's the scenario. All the tabs are the same width, the text within each tab is centered horizontally and verticaly. Also,the text inside each tab is of different lengths, ranging from 4 characters to 23 characters. Because of this, when the browser width is changed (i.e. made smaller) the longer strings of text need to wrap within their tabs to fit.
When using a styled unordered list to achieve a horizontal nav, only the tabs with the wrapped text are changed in height, not all of the tabs. That's the problem I'm trying to solve. I need all of the tabs to be the same height and width all the time, not just when the number of lines of text within each tab is the same.
You actually can't detect that via CSS. You will need javascript.
You could try setting the height of the UL, and then setting the height of the list-items to 100% to see if they fill the height of the UL when it stretches to accomodate the text wrapping.
Thanks Nick, I thought I had tried something like that, but turns out I hadn't set the height of the UL, just the LI's to 100%. Here's wat I found when I set the UL height. The method works, so long as the wrapping text height does not extend past the height of the UL, otherwise it breaks. So unfortunately, for this project I'm still stuck with the only solution being a 1 row table. Thanks though. I appreciate your help.
You can set the width, height and font-size of that menu in percentages. That should fix it, although getting it working initially will probably take slightly longer.
#topNav a { font-size: 1.2em; font-weight: bold; height: 100%; color: #006699; text-decoration: none; padding: 0px; } --> </style> </head> <body> <div id="table"> <ul id="topNav"> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3 Link 3</a></li> <li><a href="#">Link 4 Link 4 Link 4</a></li> <li><a href="#">Link 5 Link 5 Link 5</a></li> <li class="last"><a href="#">Link 6 Link 6 Link 6</a></li> <br style="clear: both;"> </ul> </div> </body> </html>
unfortunately, the above solution does not work in IE, i hear. old fashioned table is the way to go here. i tried to css-ize amazon.com's layout once, and i ran into the same problem with their submenu =/