css - Bootstrap 3 向网格系统添加间距

标签 css twitter-bootstrap

我显然在这里遗漏了一些非常明显的东西,但我想要在 Bootstrap 列之间有一个 10px 的间距。来自默认情况下有排水沟的 ui-kit,要关闭它们,您只需添加 uk-grid-collapse 类即可。

打开装订线的 Bootstrap 等效项是什么?

http://codepen.io/anon/pen/vKBjBa

<div class="row">
    <div class="col-lg-4 col-md-4 col-sm-12 col1">
        <div class="div-content">col 1</div>
    </div>
    <div class="col-lg-4 col-md-4 col-sm-6 col2">
        <div class="div-content">col 2</div>
    </div>
    <div class="col-lg-4 col-md-4 col-sm-6 col3">
        <div class="div-content">col 3</div>
    </div>
</div>

最佳答案

只需定义内部 div 的颜色即可。在这里,我从 parent 那里删除了类(class),并将类(class)传递给了 child 的div

<div class="row">
  <div class="col-lg-4 col-md-4 col-sm-12">
    <div class="div-content col1">col 1</div>
  </div>
  <div class="col-lg-4 col-md-4 col-sm-6">
    <div class="div-content col2">col 2</div>
  </div>
  <div class="col-lg-4 col-md-4 col-sm-6">
    <div class="div-content col3">col 3</div>
  </div>
</div>

因为 bootstrap 在 col- 类中有一个默认的装订线空间,所以使用它们并为内部 div 定义 background-color

The default gutter space is 15px from each side left and right so you will see the default space of 30px between the div's. If you want to change that space to 10px just write you own css with desired space and overwrite it.

关于css - Bootstrap 3 向网格系统添加间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37457364/

相关文章:

html - Bootstrap 水平下拉菜单

css - 悬停时图像滚动

css - 使用记事本将 css 文件保存为 Ansi 或 UTF-8 编码?

javascript - 动态获取数据目标

css - Sass 在 "content"CSS 属性中的 unicode 字符后添加了额外的空格

angularjs - Angular ui-router 维护选项卡之间的状态

css - 显示 '<blockquote>' IMG 时出现问题

javascript - 是否可以刷新 Bootstrap 选项卡

html - 带有显示内联 block 的 Div

html - Bootstrap容器间距