itskimical Posted May 21, 2013 Share Posted May 21, 2013 I am trying to center this menu. Right now it is a local site uploaded through WAMP - but here is the css. .main-navigation {clear: both;display: block;padding: 1.5em;}.main-navigation:after {clear: both;content: "";display: block;}.main-navigation ul {list-style: none;margin: 0 auto;padding-left: 0;}.main-navigation li {float: left;margin: 0.5em 0;position: relative;}.main-navigation a {color: #7c948a;display: block;font-size: 1.4rem;font-weight: bold;margin-right: 2em;text-decoration: none;}.main-navigation ul ul {background: #e9e0d1;border: 1px solid rgba( 0, 0, 0, 0.1 );display: none;float: left;position: absolute;top: 1.2em;left: 0;z-index: 99999;}.main-navigation ul ul ul {left: 100%;top: 0;}.main-navigation ul ul a {padding: 0 1.5em;width: 200px;}.main-navigation ul ul li {}.main-navigation li:hover > a,.main-navigation li.current_page_item a,.main-navigation li.current-menu-item a,.main-navigation ul ul a:hover {color: #33605a;}.main-navigation ul ul :hover > a {}.main-navigation ul li:hover > ul {display: block;} Any ideas? Link to comment Share on other sites More sharing options...
dsonesuk Posted May 22, 2013 Share Posted May 22, 2013 .main-navigation {clear: both;display: block;padding: 1.5em;position:relative;/*added by dsonesuk*/left:50%; /*added by dsonesuk*/float:left; /*added by dsonesuk*/}.main-navigation ul {position:relative; /*added by dsonesuk*/left:-50%; /*added by dsonesuk*/list-style: none;margin: 0 auto;padding-left: 0;} 1 Link to comment Share on other sites More sharing options...
itskimical Posted May 22, 2013 Author Share Posted May 22, 2013 Thank you for looking at this - that worked - but now I have a scroll bar at the bottom - it seemed to add length to the site. Link to comment Share on other sites More sharing options...
dsonesuk Posted May 22, 2013 Share Posted May 22, 2013 you need to add overflow:hidden to an outer parent container. 1 Link to comment Share on other sites More sharing options...
itskimical Posted May 22, 2013 Author Share Posted May 22, 2013 Thank you - that was the ticket! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now