Created
September 19, 2013 02:39
-
-
Save austinhinderer/6618501 to your computer and use it in GitHub Desktop.
This SASS mixin will vertically center a child element inside its parent.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin vertical-center($childSelector) { | |
& { | |
display: table; | |
width: 100%; | |
#{$childSelector} { | |
display: table-cell; | |
text-align: center; | |
vertical-align: middle; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment