Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Logo and menu won't centre on WordPress

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #247707
    solost
    Participant

    Hey guys, bit of a newb to wordpress/CSS and got stuck pretty early on. Alligning right and left work fine, but centre doesn’t. Attached a screenshot to show what menu and logo look like when centred. CSS here too. Did I do something stupid?

    https://s18.postimg.org/4qelmaxg9/Screen_Shot_2016_11_10_at_09_48_58.png

    From the stylesheet:

    #container {
    text-align: centre;
    margin: 0 auto;
    position: relative;
    }
    #container, #infinite-footer .container {
    width: 1280px;
    }
    #main-header {
    margin-top: 80px;
    }
    #logo {
    float: centre;
    margin-bottom: 10;
    text-transform: none;
    font-size: 38px;
    letter-spacing: 9px;
    margin-right: 30px;
    font-weight: 100;
    }
    #logo a {
    text-decoration: none;
    color: #000;
    }
    #logo a:hover {
    color: rgba(0, 0, 0, 0.5);
    }
    #top-menu {
    float: centre;
    padding-top: 14px;
    position: relative;
    }
    #top-menu li {
    display: inline-block;
    font-size: 20px;
    margin-right: 30px;
    }
    #top-menu a {
    color: #000;
    text-decoration: none;
    padding-bottom: 10px;
    display: block;
    position: relative;

    #247710
    Senff
    Participant

    Just a screenshot and a little bit of code is probably not enough to figure out the problem or explain how to solve it — it would be better if you could give us a link to your site or if you could create a reduced case in Codepen.io.

    Having said that, from your code I can see there’s a few things:
    – “text-align: centre;” should be “text-align: center;”
    – “float: centre;” (or rather, “float: center;”) doesn’t exist

    Basically, you’ll need something like this:

    http://codepen.io/senff/pen/ENPYZa

    It’s just a start, but in order to make things centered, keep in mind:
    – set “text-align:center;” on the outer container (#container in this case), and
    – none of the elements inside it should be block level OR float

    That should point you in the right direction.

    #247713
    solost
    Participant

    Amazing restraint!

    How you held back from saying, ‘learn to spell you dolt’ I’ve no idea.

    That fixed it. Cheers!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.