Forums

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

Home Forums CSS simple vertical-align with position

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

    hello guys!

    I want to have something like this:

    ///////////////////////// ///IMG////////////IMG/// ////////////////////////

    Until now, I use this:
    .top {
    background-color: red;
    line-height: 0px;
    }
    .top .logo {
    margin-left: 10%;
    }
    .top .menu {
    position: absolute;
    right: 0px;
    margin-right: 10%;
    }

    with:
    <div class="top">
    <img src="http://placehold.it/205x39" class="logo"/>
    <img src="http://placehold.it/16x16" class="menu"/>
    </div>

    CodePen: http://codepen.io/anon/pen/JpvkF How I can verticaly align “menu” image? Except margin-top if it’s possible. Thanks.

    #156976
    Vishad
    Participant

    I saw your problem, i have some solution to it . hope it might useful to you

    .top {
        background-color: red;
        line-height:0px;
    }
    .top .logo {
        margin-left: 10%;
      vertical-align:middle;
    }
    .top .menu {
      vertical-align:middle;
      margin-left:60%;
    
    }
    
    #156978
    cataiin
    Participant

    It’s ok, thank you.
    But why margin-left (not right?) and why 60? Is not the same position now…

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