33

don't even start me on vertical-align

Comments
  • 0
    .parent {
    position: relative;
    }
    .child {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    }
  • 1
    Flexbox is pure love ♥
  • 0
    .parent parent{
    display whatever
    }
    .parent{
    display table
    }
    .child{
    display table cell
    vertical align middle
    }
  • 0
    @mito that doesn't work on every browser does it?
  • 0
    As a guy who has experienced this, I want that mug!
  • 1
    @craig939393 the only browers that has given me problems are IE 10 and below.
  • 1
    With flexbox it's 2 lines of css. Unless you need to support older browsers it's the way to go.
Add Comment