I'm currently working on a Bootstrap responsive template design where I have multiple items arranged in rows. The number of items per row and the number of rows vary depending on the screen resolution.
<div class="row">
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="item"> ... </div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="item"> ... </div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="item"> ... </div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="item"> ... </div>
</div>
...
</div> <!-- / .row -->
Each item has a bottom margin to prevent them from being too close together vertically:
.item {
margin-bottom: 20px;
}
Is there a way to set the bottom margin to "0" for all items in the last row, without knowing which items will be in that specific row at different resolutions?
PS: Remember, the .row
container does not dictate that the divs inside are part of a single row. It's simply a wrapper for the .col- containers.
Check out the JSFiddle demonstration here: http://jsfiddle.net/m668fska/