Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ajaegers/10988463 to your computer and use it in GitHub Desktop.
Save ajaegers/10988463 to your computer and use it in GitHub Desktop.
/**
* 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