Skip to content

Instantly share code, notes, and snippets.

@isarmstrong
Created February 27, 2015 20:15
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 isarmstrong/6f83af639da00e323886 to your computer and use it in GitHub Desktop.
Save isarmstrong/6f83af639da00e323886 to your computer and use it in GitHub Desktop.
A quick & simple mixin that takes one arguement (relative vs absolute) and vertically aligns an element within its parent.
@mixin vertical-align($position) {
position: $position;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment