Skip to content

Instantly share code, notes, and snippets.

@harveyxia
Created June 30, 2014 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harveyxia/719f19a10c8f0938b2e8 to your computer and use it in GitHub Desktop.
Save harveyxia/719f19a10c8f0938b2e8 to your computer and use it in GitHub Desktop.
Vertically align using CSS3 transform
#parent > div {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
}
/* source: http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/ */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment