Last active
December 10, 2015 15:49
-
-
Save ajaswa/4456991 to your computer and use it in GitHub Desktop.
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="wrapper"> | |
<div class="vertically-centered"> | |
Small or large amount of content. | |
</div> | |
</div> | |
<style> | |
.wrapper { | |
/* make this as tall as you want */ | |
height: 500px; | |
} | |
.wrapper:before { | |
height: 100%; | |
} | |
.wrapper:before, | |
.vertically-centered { | |
/* The height here is dependant upon content */ | |
display: inline-block; | |
vertical-algin: middle; | |
} | |
</style> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment