Last active
August 29, 2015 13:59
-
-
Save ajaegers/10988463 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
/** | |
* How to vertical align (top | middle | bottom) your html elements | |
* @usage: | |
* <div class="valign-box"> | |
* <div class="valign-top"></div> | |
* <div class="valign-middle"></div> | |
* <div class="valign-bottom"></div> | |
* </div> | |
*/ | |
.valign-box { | |
display: table; | |
& .valign-top { | |
display: table-cell; | |
float: none; | |
vertical-align: top; | |
} | |
& .valign-middle { | |
display: table-cell; | |
float: none; | |
vertical-align: middle; | |
} | |
& .valign-bottom { | |
display: table-cell; | |
float: none; | |
vertical-align: bottom; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment