PDA

View Full Version : IE UL Menu Not Centering



shauna7084
Sep 26th, 2010, 05:21 AM
I was hoping someone could help me sort out why my UL main menu isn't centering in IE. Using margin-left auto and margin-right auto. Works fine in the other browsers...?

http://corporatewellness-solution.com/

Thanks in advance.

phpdeveloper
Sep 26th, 2010, 09:02 AM
Add left:0px !important; in your template.css file on line no 47

#art-nav{
left:0px !important;
}

Major Payne
Sep 26th, 2010, 09:59 AM
To center an element, you MUST set a width less than 100%. Then you can use the CSS property: margin: 0 auto;

Just figure out how wide your main menu is and its height including any padding, then set the CSS style for its div container. Example:



#main_menu {
width: XXXpx;
height: YYpx;
margin: 0 auto;
padding: XXpx; /* OPTIONAL */
}

<div id="main_menu"> ... menu contents here ... </div>