• Hi I have set the logo to be centered at the top of the page,

    .navbar-wrapper .brand {
    width:100%;
    display:block;
    float:center;
    }

    I would like to center the navigation below the logo but I’m not having much luck.

    Could someone show me the way =)

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Not sure about centering the navbar, but should point out that float:center doesn’t exist in CSS. You could just as well type float:adjkf. The page is probably (a) generating an error (b) dropping the declaration and then (c) falling back to the default which is float:none…which in your case (you’re lucky) happens to be the centre.

    (Just in case you try to use it in future and find it doesn’t work.)

    @ef is correct. The usual way to centre an element is to use:

    margin: 0px auto;

    Thread Starter RustyWood

    (@rustywood)

    Thanks guys, yep my mistake.

    @rdellconsulting

    I tried you code but it doesn’t seem to center the nav bar and site description under the logo.

    Thanks for you your help

    Did you mean the margin code? Wouldn’t expect that alone to resolve it. Did you try the code in the above link?

    Repeated here:

    .navbar .nav {
      display: block;
     margin-left: 35%
    }
    .navbar-wrapper .brand {
    width:100%;
    display:block;
    }
    .navbar-wrapper .social-block {
    display:none;
    }
    .span7.inside.site-description {
    float:left;
    margin-left:8%
    }
    .navbar-wrapper .navbar-inner {
    display:block;
    width:100%;
    margin-left:25%;
    max-width:75%
    }

    Thread Starter RustyWood

    (@rustywood)

    Thanks, yes I was talking about the code you posted.

    The logo aligns and floats center of the page and the site-description also does when in mobile view, but when larger than that in the desktop view, the site-description and navigation moves below the logo but to the right, is there a way to center the site-description below the logo and them have the navigation centered below that?

    I appreciate the help

    Rustywood, just adjust your widths and margins:

    .navbar .nav {
    display: block;
    margin-left: 15%
    }
    .navbar-wrapper .brand {
    width:100%;
    display:block;
    }
    .navbar-wrapper .social-block {
    display:;
    }
    .span7.inside.site-description {
    float:right;
    margin-right:23%
    }
    .navbar-wrapper .navbar-inner {
    display:block;
    width:100%;
    margin-left:25%;
    max-width:75%
    }

    Hello,
    Is there a way to shrink the height of the box surrounding the header menu? Its like 1.5 inches high, but the words on the menu are only .25 inches high.

    See my site for example: https://www.compfident.com

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to center the navigation’ is closed to new replies.