I am in trouble with new Bootstrap 3 grid system. I would like to create 4 columns grid. So here's my code:
<div class="row">
<div class="col-lg-4">...</div>
<div class="col-lg-4">...</div>
<div class="col-lg-4">...</div>
</div>
My problem is there's no gap among the columns. Grid applies padding-left and padding-right to columns instead of margin-left and margin-right.
When I remove padding and add margin, It collapses. How am I gonna fix this? or Is there something that I couldn't undestand?
To remove the gutter space, all you need to do is add the no-gutter class beside row in your HTML markup. It's that simple!
Three Equal ColumnsUse the . col class on a specified number of elements and Bootstrap will recognize how many elements there are (and create equal-width columns). In the example below, we use three col elements, which gets a width of 33.33% each.
If you can't use the default padding to create gaps, you'd have to add `margin-left' to the appropriate columns and also tweak the % width.
For example .col-lg-4
usually has 33% width, so you'd decrease it a little..
.col-lg-4 {
margin-left:15px;
width:31.6%;
}
http://bootply.com/74374
Another option would be to use a container inside the columns, and then the padding will work to create the gaps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With