Created
May 2, 2013 16:53
-
-
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.
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
// | |
// 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