Skip to content

Instantly share code, notes, and snippets.

@sajadtorkamani
Created May 23, 2015 11:56
Show Gist options
  • Save sajadtorkamani/bf38c965527bb160ce66 to your computer and use it in GitHub Desktop.
Save sajadtorkamani/bf38c965527bb160ce66 to your computer and use it in GitHub Desktop.
// Vertically enter an element of unknown height
.parent {
position: relative;
}
.child {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment