For the main nav of my site, there is a 980px wide div with a ul for the main nav links. I am trying to make the nav links stretch to fit the width of the div evenly.
This is the easiest way to do it: http://jsfiddle.net/thirtydot/jwJBd/
(or with table-layout: fixed for even width distribution: http://jsfiddle.net/thirtydot/jwJBd/59/)
This won't work in IE7.
#horizontal-style {
display: table;
width: 100%;
/*table-layout: fixed;*/
}
#horizontal-style li {
display: table-cell;
}
#horizontal-style a {
display: block;
border: 1px solid red;
text-align: center;
margin: 0 5px;
background: #999;
}
Old answer before your edit: http://jsfiddle.net/thirtydot/DsqWr/