Looking for help on centering 2 menus on a menubar to ensure compatibility with IE7,IE8,IE9, Chrome, and FF. I have provided measurements for both menus based on Chrome for reference.
Menu 1:
<div id="outer-menu-bar" style="width:800px;height:32px;">
<div id="inner-menu" style="width:578px;height:32px;">Foo foo</div>
</div>
Menu 2:
<div id="outer-menu-bar" style="width:800px;height:32px;">
<div id="inner-menu" style="width:285px;height:32px;">Foo foo</div>
</div>
I attempted using the CSS style #inner { width: 50%; margin: auto; } suggested in How to horizontally center a <div> in another <div>?. However, the larger menu exceeded 50%, resulting in clipping, while the smaller one shifted 20 pixels to the left. We temporarily resolved this using jQuery during prototyping, but we want a better solution as the positioning jumps after loading.
Any suggestions or ideas?