Skip to content

Instantly share code, notes, and snippets.

@edm00se
Last active August 29, 2015 14:03
Show Gist options
  • Save edm00se/8ad4d0f298c891c44f2a to your computer and use it in GitHub Desktop.
Save edm00se/8ad4d0f298c891c44f2a to your computer and use it in GitHub Desktop.
Consistent responsive row column height in Bootstrap 3.
/*
* Provides Bootstrap 3 compatible classes for making responsive rows and columns consistently formatted for height.
* src: http://www.minimit.com/articles/solutions-tutorials/bootstrap-3-responsive-columns-of-same-height
*/
/* columns of same height styles */
.row-same-height {
display: table;
width: 100%;
}
.col-xs-height {
display: table-cell;
float: none !important;
}
@media (min-width: 768px) {
.col-sm-height {
display: table-cell;
float: none !important;
}
}
@media (min-width: 992px) {
.col-md-height {
display: table-cell;
float: none !important;
}
}
@media (min-width: 1200px) {
.col-lg-height {
display: table-cell;
float: none !important;
}
}
/* vertical alignment styles */
.col-top {
vertical-align:top;
}
.col-middle {
vertical-align:middle;
}
.col-bottom {
vertical-align:bottom;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment