【问题标题】:How to remove the default margin-left from the span?如何从跨度中删除默认的左边距?
【发布时间】:2012-10-04 21:57:39
【问题描述】:

我有一个这样的行流体

<div class="row-fluid">
    <div class="span1"></div>
    <div class="span6"></div>
    <div class="span5"></div>
</div>

现在我需要从 span6 中删除 margin-left ... 我尝试通过设置 margin:0px 在 bootstrap.css 文件上执行此操作,但这会影响 span5。如何有效去除 span6 中的 margin-left?

问候, 纳西尔

【问题讨论】:

    标签: css html twitter-bootstrap


    【解决方案1】:
    .span6 {
        margin: 0px; 
    }
    

    只需将它放在您自己的自定义 CSS 文件中,该文件在 Bootstrap 文件之后运行。

    【讨论】:

    • 我这样做了,但它会影响其他跨度
    • 它只能影响类span6的其他元素。例如,您可以将一个类 no-margin 添加到要删除边距的 div 中,并提供该类 margin: 0;。
    【解决方案2】:

    使用!important覆盖Css

    .span6 {
        margin: 0px !important; 
    }
    

    【讨论】:

      猜你喜欢
      • 2016-11-19
      • 2019-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-29
      • 2012-05-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多