如何删除引导列之间的空间? [英] How to remove space between bootstrap columns?

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

问题描述

我想删除引导网格中多列之间的空格。我们如何重写Bootstraps CSS来实现这个任务或者使用纯CSS实现其他更好的解决方案?

main.html

 < div class =row> 
< div class =col-md-2>
//这里为这一列填写
< / div>
< div class =col-md-10>
//这里填写列
< / div>
< / div>


解决方案

在需要删除空格时添加一个类

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

在html中写入这个类

 < div class =row> 
< div class =col-md-2 padding-0>
//这里为这一列填写
< / div>
< div class =col-md-10 padding-0>
//这里填写列
< / div>
< / div>


I want to remove the space between multiple columns in the bootstrap grid. How can we overwrite Bootstraps 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>

解决方案

add a class when you need to remove spaces use it

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

in html write this class

<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天全站免登陆