The only way to space items automatically in CSS is by using display: table;
and table-cell
and table-layout: fixed;
. It works in every modern browser and IE8, as it's CSS2.1 recently supported everywhere.
Check first example of this jsFiddle: http://jsfiddle.net/aznxD/
Resetting CSS for lists is done by indicating:
ul {
margin: 0;
padding: 0;
}
No need for changing list-style
if you already change the value of display
for li
. The 40 other lines of various reset CSS are for other things than lists, that's OT here.
The second example in previous fiddle is for IE6/7, by using sort of display: inline-block
(see comment in CSS and in the JS left-bottom part of screen) and calculated padding that will depend of the number of items in menu and length of text. That's why items won't space automatically... You can add these specific rules via conditional comments in a specific stylesheet or around html element with class(es).
This is not pixel perfect... but it isn't that important: nobody except you will see your site in numerous browsers and their different versions.
Maybe some people will see your site on two browsers, one at work and another one at home. Will they notice that my example is 957px wide and not 960px anymore? Will they care or will they be glad that it's less horrible than most sites designed for "modern browsers" with no care and tests at all for old browsers? (designing for modern browsers isn't a problem, not caring at all for older ones with no fallback is a problem)
IMHO your time will be better used at providing media queries in support of Responsive Web Design and maybe Mobile First in a second or third time and removing every unused CSS rule in your CMS if it's bloated: better maintenance in the future and better performance now and in the future.