Center main nav
-
Hi, I changed around a few things in my main navigation (www.12minuteathlete.com) and it’s no longer centered like before. Here is my custom CSS:
@media only screen and (max-width: 1024px) {
#navigation ul li:hover ul {
display: none;
}#navigation ul#main-nav {
text-align: center;
}#navigation ul li {
display: inline-block;
}
}@media only screen and (max-width: 767px) {
h3.nav-toggle.icon {
display: none;
}#navigation {
position: relative !important;
width: 95% !important;
padding: 0 !important;
left: 0 !important;
background: transparent !important;
margin: 0 auto;
-webkit-transform: translate3d(0,0,0) !important;
-moz-transform: translate3d(0,0,0) !important;
-ms-transform: translate3d(0,0,0) !important;
-o-transform: translate3d(0,0,0) !important;
transform: translate3d(0,0,0) !important;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
}#navigation .nav-home, #navigation h3, #navigation .nav-close {
display: none;
}#navigation ul#main-nav {
width: 260px !important;
min-width: 260px !important;
max-width: 100% !important;
margin: 0 auto !important;
}#navigation ul li {
position: relative;
display: inline-block;
}#navigation ul li a {
font: bold 16px/1.2em “Helvetica Neue”, Helvetica, sans-serif;
color: #000000;
padding: 1em 1em 0 !important;
}#navigation ul li a:hover, #navigation ul li:hover ul li a:hover {
color: #7a797a !important;
}#navigation ul li ul {
display: none;
}#navigation ul li ul {
background: #fff !important;
margin: 0 !important;
position: absolute;
top: 30px;
z-index: 1;
}#navigation ul li:hover ul {
/*display: block;*/
}#navigation ul li:hover ul li a {
color: #000000 !important;
}#navigation ul.nav li ul li a {
white-space: nowrap;
font-weight: normal;
text-transform: none;
font-size: 15px;
}#navigation ul.nav li ul {
text-align: left !important;
padding: 0 0 10px;
top: 35px;
}#navigation ul.nav li ul li {
width: 100%;
}ul.nav li.current_page_item a, ul.nav li.current_page_parent a, ul.nav li.current-menu-ancestor a, ul.nav li.current-cat a, ul.nav li.current-menu-item a {
background: transparent !important;
color: #3088ff;
}
}@media only screen and (max-width: 480px) {
#navigation ul.nav li ul li a {
white-space: normal;
}
}@media only screen and (max-width: 300px) {
#navigation ul#main-nav {
width: 100% !important;
min-width: 100% !important;
}
}Anyone know what to change to force it to center?
-
Looks centred now? Did you fix it?
It’s slightly to the left and I can’t seem to get it to move.
You’ve set a min-width on the navigation menu:
ul#main-nav { min-width: 696px; list-style: none; }
Interesting… so in my actual custom CSS, it says this:
@media only screen and (max-width: 767px) {
h3.nav-toggle.icon {
display: none;
}Changing that to make it smaller (512px is what it should be) does nothing. Where would I change the minimum width?
It’s embedded in the header of your site with a collection of other CSS rules. The comment above them all is this:
<!-- Options Panel Custom CSS -->
I reckon that’s a Custom CSS plugin.
I figured it out! Apparently I have two custom CSS areas, I had no idea. Changing the min width in the second one worked perfectly. Thanks for your help!
- The topic ‘Center main nav’ is closed to new replies.