• Resolved mhensler

    (@mhensler)


    I’m working on a child theme based off of Striker (Website can be viewed here).

    I would like to center the navigation in the top navigation bar. I’ve tried a few tricks (including using inline-block in place of floats), but nothing is working. Any ideas?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Removing the “float” from here seems to work:

    .main-navigation ul {
        float: left;
        list-style: outside none none;
        margin: 0;
        padding: 4px 12px;
    }

    Thread Starter mhensler

    (@mhensler)

    Thanks, didn’t seem to work for me, though.

    Thread Starter mhensler

    (@mhensler)

    Here’s an excerpt straight from my child stylesheet:

    .main-navigation {
    	font-family: 'Roboto', sans-serif;
    	clear: both;
    	display: block;
    	padding: 0.1em;
    	border-radius:0.4em 0.4em 0 0;
    	/*background-color:#AB8342;*/
    	margin-top: 5px;
    	margin-bottom: 0;
    	max-width: 1049px;
    	-webkit-box-shadow: 0px 4px 2px 0px inset rgba(50, 50, 50, 0.50);
    	-moz-box-shadow:    0px 4px 2px 0px inset rgba(50, 50, 50, 0.50);
    	box-shadow:         0px 4px 2px 0px inset rgba(50, 50, 50, 0.50);
    	border-top: 1px solid #CCCCCC;
    	background-image:url(images/main_bg_leather.jpg);
    	background-repeat:repeat-x repeat-y;
    }
    .main-navigation:after {
    	clear: both;
    	content: "";
    	display: block;
    }
    .main-navigation ul {
    	list-style: outside none none;
    	margin: 0;
    	padding: 4px 12px;
    
    }
    .main-navigation li {
    	float: left;
    	margin: 0;
    	position: relative;
    }
    .main-navigation a {
    	color: #FFF;
        display: block;
        font-size: 1.4rem;
    	font-size: 14px;
        font-weight: normal;
        margin-right: 1em;
        text-decoration: none;
    	text-transform: uppercase;
    	padding: 0.4em 0.6em .1em .6em;
    	word-spacing: 2px;

    Okay, try changing it to this:

    .main-navigation ul {
    	list-style: outside none none;
    	margin: 0;
    	padding: 4px 12px;
      display: table;
      margin: 0 auto;
    
    }

    BTW, I can see all the CSS on your site – no need to post it here.

    Thread Starter mhensler

    (@mhensler)

    Works perfectly. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Centering the navigation horizontally.’ is closed to new replies.