Grow your CSS skills. Land your dream job.

Cannot align menu-div centered

  • # June 18, 2013 at 11:59 am

    Hey all,

    Can anybody tell me where’s my mistake?
    The menue should be aligned in the center
    of the body.

    [Your text to link here…](http://codepen.io/clipp/pen/aydCh “klick here”)

    # June 18, 2013 at 12:01 pm

    Try this:

    .navigation ul{
    text-align:center;
    }

    .navigation ul li{
    display:inline-block;

    }

    # June 18, 2013 at 12:07 pm

    @Paulie_D, need block too (it’s set to inline-block now)

    .navigation ul {
    display: block;
    text-align: center;
    }

    # June 18, 2013 at 12:07 pm

    Thank you!

    Can you explain in short why it’s working right now?

    # June 18, 2013 at 12:14 pm

    But I see that the text-parts in the header are not aligned correctly:

    [Your text to link here…](http://codepen.io/clipp/pen/aydCh “http://codepen.io/clipp/pen/aydCh”)

    The menue has more space on its left side than on his right side.

    # June 18, 2013 at 12:27 pm

    Add `padding: 0;` to `.navigation ul`.

    # June 18, 2013 at 12:32 pm

    Great, that’s it.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".