【问题标题】:Why does this render differently between Chrome & Firefox 3.6?为什么这在 Chrome 和 Firefox 3.6 之间呈现不同?
【发布时间】:2011-04-26 15:56:20
【问题描述】:

http://jsbin.com/ohuwu4/5

(示例取自Google's CSS walkthrough

顺便说一句,我试图通过验证,但我无法让 jsbin 在 <script> 标记上放置类型属性。

【问题讨论】:

    标签: css firefox google-chrome


    【解决方案1】:

    我想是这个collapsing margin bug

    将 CSS 更改为:

    #wd-c div { margin: 0 1em 1em; }
    

    似乎可以修复它(我确认它是错误报告中提到的margin-top CSS)。但是,您会失去所有不需要的 <div>s 的边距。

    为了解决这个问题,我接着补充说:

    #wd-1 { margin-top:1em !important; }
    

    将它放回第一个,它在两个浏览器中呈现相同。

    【讨论】:

      猜你喜欢
      • 2014-04-25
      • 2012-09-25
      • 2015-04-27
      • 2015-02-26
      • 1970-01-01
      • 1970-01-01
      • 2021-10-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多