Update 2021
Bootstrap 5 the .no-gutters
class has been replaced with .g-0
. Use it on the .row
where you want no spacing between columns.
Bootstrap 5 also has new gutter classes that are specifically designed to adjust the gutter for the entire row. The gutters classes can be used responsively for each breakpoint (ie: gx-sm-4
)
- use
g-0
for no gutters
- use
g-(1-5)
to adjust horizontal & vertical gutters via spacing units
- use
gy-*
to adjust vertical gutters
- use
gx-*
to adjust horizontal gutters
Bootstrap 4 now includes a .no-gutters
class that you can just add to the .row
.
<div class="row no-gutters">
<div class="col">x</div>
<div class="col">x</div>
<div class="col">x</div>
</div>
Bootstrap 4: http://codeply.com/go/OBW3RK1ErD
Bootstrap 3.4.0+ gutters are created using padding, but they added a .row-no-gutters
class. See the documentation for Bootstrap 3.4 and look for 'Remove gutters'.
HTML you can use:
<div class="row row-no-gutters">
<div class="col">x</div>
<div class="col">x</div>
<div class="col">x</div>
</div>
Bootstrap 3+, <= 3.3.9 gutters are created using padding. You also must adjust the negative margin so that spacing around the outer columns is not affected.
.no-gutter {
margin-right: 0;
margin-left: 0;
}
.no-gutter > [class*="col-"] {
padding-right: 0;
padding-left: 0;
}
Just add the no-gutter
class to the .row
.
Demo: http://bootply.com/107458