【问题标题】:Remove gutter gap from div in Bootstrap 2从 Bootstrap 2 中的 div 中删除排水沟间隙
【发布时间】:2020-05-13 17:59:42
【问题描述】:

请注意,我继承了一个项目并且必须使用 Bootstrap 2。

我有以下代码在页面左上角显示网站徽标,由于某种原因,由于使用网格系统时的排水沟,此图像被“推”到右侧 - 我该如何删除它这单行的差距?

<div class="row">
   <div class="span12">
     <img src="/img/logo.png">
  </div>
</div><!-- end row -->

任何建议都将不胜感激,请注意这是使用 Bootstrap 2 而不是更新的改进的 Bootstrap 3。

【问题讨论】:

    标签: css twitter-bootstrap twitter-bootstrap-2


    【解决方案1】:

    添加一个新类,并设置为margin 0

    .nogutter {
      margin: 0px !important;
    }
    <div class="row nogutter">
      <div class="span12">
        <img src="/img/logo.png">
      </div>
    </div>
    <!-- end row -->

    【讨论】:

    • 奇怪..这似乎对我不起作用,尽管您的代码看起来很准确......我会仔细查看一定是其他冲突
    • 您可以尝试将 !important 放入规则中...我更新了 css 代码。这意味着您的规则高于一切。
    • 应该是margin: 0px !important;fyi
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-10-10
    • 1970-01-01
    • 1970-01-01
    • 2019-11-20
    • 1970-01-01
    • 2014-10-30
    相关资源
    最近更新 更多