我想删除 Bootstrap 网格中多列之间的空格。
我们如何覆盖 Bootstrap 的 CSS 来完成此任务或使用纯 CSS 的任何其他更好的解决方案?
main.html
<div class="row">
<div class="col-md-2">
// stuff here for this column
</div>
<div class="col-md-10">
// stuff here for columns
</div>
</div>
最佳答案
在 Bootstrap 5 中,no-gutters
类已更改为 g-0
在 Bootstrap 4 中,包含了 no-gutters
类。不需要额外的 CSS...
<div class="row no-gutters">
<div class="col-md-2">
// stuff here for this column
</div>
<div class="col-md-10">
// stuff here for columns
</div>
</div>
关于css - 删除列之间的间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40267056/