Bootstrap's default grid system includes 30px gutter space between columns, resulting in a row with 360px of unused space if gutters are removed completely. To address this, while maintaining Bootstrap responsiveness, follow these steps:
Bootstrap 5 introduced specific gutter classes:
Example:
<div class="row g-0"> <div class="col">...</div> <div class="col">...</div> <div class="col">...</div> </div>
Bootstrap 4 provides the no-gutters class for rows:
<div class="row no-gutters"> <div class="col">...</div> <div class="col">...</div> <div class="col">...</div> </div>
Bootstrap 3 introduced the use of padding instead of margins for gutters. To achieve this effect:
.row.no-gutter { margin-left: 0; margin-right: 0; }
.row.no-gutter [class*='col-']:not(:first-child), .row.no-gutter [class*='col-']:not(:last-child) { padding-right: 0; padding-left: 0; }
<div class="row no-gutter"> <div class="col-lg-1">...</div> <div class="col-lg-1">...</div> <div class="col-lg-1">...</div> </div>
The above is the detailed content of How Can I Remove or Adjust Gutter Space in Bootstrap for Specific Divs?. For more information, please follow other related articles on the PHP Chinese website!