michaelbarys
5/30/2016 - 4:15 PM

Vertical align anything with just 3 lines of CSS http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/

Vertical align anything with just 3 lines of CSS http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/

.parent-element {
  -webkit-transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

.element {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}