What is the best way to adjust the li elements to fill the entire width of the div the tab bar will be located in?
A:
i'd prefer not to have to use width:33%
, but this works.
<html>
<head>
<style type="text/css">
div.menuTop {width:400px;border:1px solid red;}
div.menuTop li {float:left; width:33%; border:1px solid green;}
</style>
</head>
<body>
<div class="menuTop">
<li>one</li>
<li>two</li>
<li>three</li>
<div style="clear:both;"></div>
</div>
</body>
hope that helps.
pstanton
2010-01-28 20:56:09
Put 4 <li> in your <ul>, use 25% ;) and using display:inline-box prevents you from using the extra <div> to clear the float.
gregseth
2010-01-28 21:05:59
You're aware that using `<li>` elements outside of a `<ul>` or `<ol>` is invalid?
David Thomas
2010-01-28 21:46:16
why not post a better solution?
pstanton
2010-01-29 04:17:35