Forums

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

Home Forums CSS Cannot align menu-div centered

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #45632
    clipp
    Member

    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”)

    #139184
    Paulie_D
    Member

    Try this:

    .navigation ul{
    text-align:center;
    }

    .navigation ul li{
    display:inline-block;

    }

    #139187
    CrocoDillon
    Participant

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

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

    #139188
    clipp
    Member

    Thank you!

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

    #139191
    clipp
    Member

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

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

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

    #139197
    CrocoDillon
    Participant

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

    #139198
    clipp
    Member

    Great, that’s it.

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