tags:

views:

30

answers:

1

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
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
You're aware that using `<li>` elements outside of a `<ul>` or `<ol>` is invalid?
David Thomas
why not post a better solution?
pstanton