DJRobThaMan
03-26-2008, 12:36 PM
Hi,
Another quick question (or at least hopefully not too difficult).
In the same project that I'm having this unrelated issue (http://www.webdeveloper.com/forum/showthread.php?t=177218), I am trying to fancy up my main menu a bit and can only get it about 98% correct.
My code looks something like this:
<ul id="main">
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
...
</ul>
#main
{
border-bottom: 1px solid #9a8d66;
list-style: none;
height: 1.2em;
margin: -20px 0px 0px 75px;
display: table;
}
#main li
{
float: left;
margin-right: 0.5em;
height: 1.2em;
display: table-cell;
}
What I want is for the menu items to be displayed side by side and for there to be a single border underneath them that is the same width as the sum of all the items. This I have achieved with the above code.
BUT
If I resize the text with the browser until it wraps to more than one line and then size it back to a smaller size, no matter how I size it, the text never goes back to being on the same line. It remains on 2 or 3 or however many were the most lines that the test wrapped to.
Does anyone know how I can tweak the above code (or even completely overhaul it) to fix the situation so that after the text wraps and I size it smaller it goes back to one line.
Thanks
Another quick question (or at least hopefully not too difficult).
In the same project that I'm having this unrelated issue (http://www.webdeveloper.com/forum/showthread.php?t=177218), I am trying to fancy up my main menu a bit and can only get it about 98% correct.
My code looks something like this:
<ul id="main">
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
...
</ul>
#main
{
border-bottom: 1px solid #9a8d66;
list-style: none;
height: 1.2em;
margin: -20px 0px 0px 75px;
display: table;
}
#main li
{
float: left;
margin-right: 0.5em;
height: 1.2em;
display: table-cell;
}
What I want is for the menu items to be displayed side by side and for there to be a single border underneath them that is the same width as the sum of all the items. This I have achieved with the above code.
BUT
If I resize the text with the browser until it wraps to more than one line and then size it back to a smaller size, no matter how I size it, the text never goes back to being on the same line. It remains on 2 or 3 or however many were the most lines that the test wrapped to.
Does anyone know how I can tweak the above code (or even completely overhaul it) to fix the situation so that after the text wraps and I size it smaller it goes back to one line.
Thanks