Skip to content

Instantly share code, notes, and snippets.

@isarmstrong
Created February 27, 2015 20:15
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