If you want to support IE6/7, you have a couple of options. You can either add an extra internal element or experiment with negative margins. A better approach would be to use a list for your navigation and style the links within it, like so:
<ul id="nav">
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
This is the most semantic way to mark up navigation (update: prior to HTML5, but now you can simply wrap the list in a nav
element). Your CSS could then look like this:
#nav li {
float: left;
width: 20%;
}
#nav li a {
display: block;
border: 1px solid #000;
}
Alternatively, you can play around with the CSS3 box-sizing property, which is supported by modern browsers (excluding IE6/7) with some additional code:
#nav li {
/* Opera 8.5+ and CSS3 */
box-sizing: border-box;
/* Firefox 1+ */
-moz-box-sizing: border-box;
/* IE8 */
-ms-box-sizing: border-box;
/* Safari 3+ */
-webkit-box-sizing: border-box;