Last active
August 29, 2015 14:09
-
-
Save jacksonhoose/48d3c7601c3bbe4fa96b to your computer and use it in GitHub Desktop.
A nice way to vertically center content
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
<div class="auto-v-center"> | |
<h2>Vertically Centered Stuff</h2> | |
<p>Indeed</p> | |
</div> | |
// scss | |
.auto-v-center { | |
@include inline-block(middle); | |
height:100%; | |
&:before { | |
@include inline-block(middle); | |
content: ''; | |
height:100%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment