Skip to content

Instantly share code, notes, and snippets.

@apollwebservices
Last active November 11, 2016 19:49
Show Gist options
  • Select an option

  • Save apollwebservices/560855026d22526814b2f4019a11aae5 to your computer and use it in GitHub Desktop.

Select an option

Save apollwebservices/560855026d22526814b2f4019a11aae5 to your computer and use it in GitHub Desktop.
Vertical and Horizontal Alignment
.vertical-align() {
display: block;
position: absolute;
top: 50%;
transform: perspective(1px) translateY(-50%);
}
.vertical-horizontal-align() {
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment