Home >Web Front-end >CSS Tutorial >How to Remove Bootstrap Column Gutters Without Negative Margins?
Problem:
How to remove the default 30px spacing between columns in Bootstrap without resorting to setting negative margins?
Solution:
Depending on your Bootstrap version, here are the recommended approaches:
Bootstrap 5:
Bootstrap 4:
<div class="row no-gutters"> <div class="col">x</div> <div class="col">x</div> <div class="col">x</div> </div>
Bootstrap 3.4.0 :
Bootstrap 3 , <= 3.3.9:
.no-gutter { margin-right: 0; margin-left: 0; } .no-gutter > [class*="col-"] { padding-right: 0; padding-left: 0; }The above is the detailed content of How to Remove Bootstrap Column Gutters Without Negative Margins?. For more information, please follow other related articles on the PHP Chinese website!