Forums

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

Home Forums CSS So, Why Isn’t This Vertically Aligned?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #44639
    siouxfan45
    Participant

    [The Codepen can be found here.](http://codepen.io/anon/pen/gpHCL “”)

    I’m unsure why this doesn’t vertically align the group of text (including an h2 and content); is it my CSS or my HTML?

    #134505
    Paulie_D
    Member

    You mean like this?: http://codepen.io/anon/pen/GgJBr

    #134510
    jimmy
    Participant

    Generally the safest way to vertically align something doesn’t really use vertical-align _at all_.

    http://codepen.io/anon/pen/iowhL

    #134515
    CrocoDillon
    Participant

    That’s if you want something vertical aligned within its parent. If you want two elements next to each other vertical aligned you can use vertical-align. Give the span `display: inline-block` and a width small enough so it fits next to the image, and remove the float property from the image.

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