【问题标题】:How to fill these gap's b/w these two columns in bootstrap? [duplicate]如何填补引导程序中这两列之间的这些空白? [复制]
【发布时间】:2017-06-10 11:52:53
【问题描述】:

我正在使用 bootstraps gird,我得到了列之间的差距:

p {
  height: 400px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
  <div class="row">
    <div class="col-md-6">
      <p>Huge text</p>
    </div>
    <div class="col-md-6">
      <p>Huge text</p>
    </div>
  </div>
</div>

【问题讨论】:

  • 发生这种情况是因为列通过填充创建了排水沟(列内容之间的间隙)。该填充通过 .rows 上的负边距在第一列和最后一列的行中偏移。
  • 在发布关于 SO 的问题之前,请先进行一些研究。检查这个Question
  • 每一列 col 左右都有 15px 的内边距。

标签: html css twitter-bootstrap


【解决方案1】:

这个排水沟是标准的引导行为。一个有趣且非常有用的 sn-p 覆盖它是:

.row.no-gutter > [class*='col-'] {
   padding-right:0;
   padding-left:0;
}

用于:

<div class="row no-gutter">

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-10
    • 2017-04-19
    • 2019-02-05
    • 1970-01-01
    相关资源
    最近更新 更多