Forums

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

Home Forums CSS [Solved] Header elements positioning

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #236496
    gombroo
    Participant

    Hello,
    quick question – how to move phone number and e-mail a little bit upwards? I’d like to place them in the middle of header container and closer to the logo.
    http://royal-camp.pl/
    Thank you!

    #236498
    Chris House
    Participant

    A quick and dirty solution is to give the #address and #phone elements a negative top margin. margin-top: -70px puts them roughly in the middle. There are more elegant solutions, but this should get you there.

    #236564
    gombroo
    Participant

    And not so dirty solution? :)

    #236570
    Paulie_D
    Member

    Restructure the whole header so the whole thing elements appear in DOM order so you don’t have to use floats.

    Make them all inline-block, center and vertical align them..then use left/right margins to create the spacing you need.

    #236571
    Alen
    Participant

    Yup what @paulie_d said.

    Here’s a quick proof of concept

    http://codepen.io/alenabdula/pen/BjRggG

    #236572
    Paulie_D
    Member

    Or flexbox…which works without all the extra divs

    http://codepen.io/Paulie-D/pen/YwVmGL}

    #236581
    gombroo
    Participant

    Flexbox did the job! Thanks @Paulie_D! I love this forum :D

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