删除列之间的间距 [英] Remove spacing between cols

查看:141
本文介绍了删除列之间的间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想删除Bootstrap网格中多列之间的空间.

I want to remove the space between multiple columns in the Bootstrap grid.

我们如何覆盖Bootstrap的CSS来完成此任务或使用纯CSS的任何其他更好的解决方案?

How can we overwrite Bootstrap's CSS to achieve this task or any other better solution with pure 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>

推荐答案

添加需要删除空格的类

.padding-0{
    padding-right:0;
    padding-left:0;
}

在html中编写此类

<div class="row">
   <div class="col-md-2 padding-0">
       //stuff here for this column
   </div>
   <div class="col-md-10 padding-0">
       //stuff here for columns
   </div>
</div>

这篇关于删除列之间的间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆