Skip to content

Instantly share code, notes, and snippets.

@data-enhanced
Created May 2, 2013 16:53
Show Gist options
  • Save data-enhanced/5503612 to your computer and use it in GitHub Desktop.
Save data-enhanced/5503612 to your computer and use it in GitHub Desktop.
LESS to display a products grid that can dynamically adjust the number of products per row, while keeping each row the height of the tallest product div. Using CSS 2 display: inline-table. Compatible with IE8 and better browsers.
//
// Products Grid
// --------------------------------------------------
@media screen and (min-width: @tablet-min-width) {
.products-grid {
display: table;
.product-item {
display: inline-table;
width: 46%;
margin-left: 2%;
padding-bottom: 32px;
img {
width: 100%;
}
.btn {
.pull-right;
}
}
}
}
@media screen and (min-width: @desktop-min-width) {
.products-grid .product-item {
width: 30%;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment