【问题标题】:Why is IE9, FF,opera adding 20%+ margin vs chrome?为什么 IE9、FF、opera 比 chrome 增加 20%+ 边距?
【发布时间】:2012-07-22 04:00:39
【问题描述】:

LIVE CODE

如何将class="content_push" 的边距固定为跨浏览器的统一。

Chrome 给了我我喜欢的视图 对比 IE9,opera,ff,看起来像:

<div class="content_push">
  <section class="cc">
    <div class="margin_wrapper">
      <header>
        <hgroup>
          <h1 class="at">rocking grass out styles for everyone.</h1>
          <h2 class="ast">The you mice structure for to of almost ability an trying the when designer dissolute that constructing in quickly distinct...</h2>
        </hgroup>
      </header>
      <h3 class="title_header">the good</h3>
      <p></p>
      <h3 class="title_header">the bad</h3>
      <p></p>
      <h3 class="title_header">the ugly</h3>
      <p></p>
    </div>
  </section>

</div>

CSS

.mc {
min-height:100%;
    width:100%;
    background:#fff;
    z-index:1;
    position:absolute;
    border-top:1px #c9cacc solid;
}

.content_push {
    margin-top:-35%;
    position:absolute;
    z-index:10;
    background:#FFF;
}

【问题讨论】:

    标签: html css


    【解决方案1】:

    我不知道它是否会起作用(我认为它会起作用),但您可以尝试“重置”css,然后它们会应用您的样式。在此处查看:http://meyerweb.com/eric/tools/css/reset/ 在使用样式之前应用此 URL 中显示的样式。还有其他的css重置器,谷歌搜索一下。

    【讨论】:

    • 是的,我使用 top:60%;而不是 margin-top:-35%;非常不稳定......知道为什么这是真的吗?我尝试了重置,margin-top:-35% 仍然不行。
    • 也许这些浏览器对 margin-top 的解释不同。我真的不确定。尝试谷歌搜索来验证这个问题。如果可能,请在您的帖子中分享您的结果。会很好的。
    • @MatthewHarwood - 我知道至少 IE 不喜欢负边距。
    猜你喜欢
    • 2013-03-26
    • 2015-12-31
    • 2011-12-10
    • 1970-01-01
    • 2015-10-01
    • 2015-02-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多