This is an ancient topic, but I swear it turned out to be harder than it should be.
I created jsfiddle to show the problem. http://jsfiddle.net/motocomdigital/VfDfw/1/
I thought I hacked it, but it does not work in IE 8 compatibility mode.
Problem
I have a navigation menu in a pretty unordered list. A wrapper div that contains a fixed width, which is the main width of the website.
An unordered list should float in the center of the wrapper. But none of the block elements in the navigation has a set width.
http://jsfiddle.net/motocomdigital/VfDfw/1/
I colored each element in a different background color so that you can see each element.
I thought I found a purchase with half the width of the wrapper on div.nav as the left position, and then -50% margin-left on .nav ul - but it does not seem to work in IE 8 compatibility mode, see the fiddle below ...
http://jsfiddle.net/motocomdigital/VfDfw/2/
Can anyone suggest a solution or a more efficient CSS method. He bakes my noodles.
thanks
Update
I thought I should update my question why I use each div in my sample script.
Watch my new violin. http://jsfiddle.net/motocomdigital/VfDfw/3/
Now I have added a top 10px position for each element so you can see why I used so many divs. But the only problem is that this solution does not support IE 7. Therefore, I need another solution for the centering elements of the block. I want a CSS rule float: center !

- The blue div is my horizon 100% div width for my navigation an endless background image.
- The red div is the wrapper that is the maximum width of my website. Script width: 420 pixels.
- The green div is the floating width of my dynamic navigator, located on the left: 210 pixels (50% of the width)
- Yellow ul is the floating width of dynamic nav li elements with a negative margin of 50%
- Blue li are containers with anchor buttons with dividers.
Hope this makes sense. But this solution almost worked, but it’s a shame that it doesn’t work. IE7