【问题标题】:Firefox and IE looks different in ChromeFirefox 和 IE 在 Chrome 中看起来不同
【发布时间】:2012-05-30 16:47:51
【问题描述】:

我想要的样式在 Chrome 中,但在 Firefox 和 IE 中看起来不同。除了“名称”字段外,我的所有字段都向右浮动。是关于漂浮的吗? 我的铬:

我的 Firefox 和 IE:

除了“状态”之外还有一个巨大的空格,并且标题看起来也更高。

===CSS====

.column-name { margin: 2px; width: 40%; }
.column-priority { float: right; margin: 2px 12px; text-align: center; width: 100px;}
.column-severity { float: right; margin: 2px 12px; text-align: center; width: 100px;}
.column-status { float: right; margin: 2px; width: 100px;}

===HTML====

   <div class="results-header ">
        <div class="column-status" value="status">Status<span class="sort jive-icon-sml"></span></div>  
        <div class="column-severity" value="severity">Severity<span class="sort jive-icon-sml"></span></div>
        <div class="column-priority" value="priority">Priority<span class="sort jive-icon-sml jive-icon-arrow-generic-down"></span></div>   
        <div class="column-name"  value="name" >Name</div>
    </div>

【问题讨论】:

  • 看起来您正在显示表格数据,HTML 有一个标签。
  • 您已经提出了 31 个问题,但接受的答案很少。哦,在其他人指出之前,你的代码在哪里?!
  • @PaoloBergantino:我实际上使用的是 Jive 平台,这是 Jive 中的小部件之一。
  • @AshwinGanesh :我上传了部分代码。

标签: css internet-explorer firefox google-chrome css-float


【解决方案1】:

始终使用 css 重置 {margin: 0;填充:0;边框:0;大纲:0;} 因为每个浏览器都有自己的边距、填充...

【讨论】:

    【解决方案2】:

    我 99% 确定这是因为您需要知道它具有哪个填充,因为在那些浏览器中它具有更高的优先级。

    你可以制定一个明星规则

    *{margin:0; padding:0;}
    

    但在我可以 100% 告诉你该做什么之前,你需要再次发布更多代码。顺便说一句,如果您不确定与浏览器兼容性有关的任何事情,请参阅:http://www.quirksmode.org/css/contents.html

    【讨论】:

      猜你喜欢
      • 2014-02-18
      • 2021-04-18
      • 2015-08-30
      • 2017-10-20
      • 1970-01-01
      • 1970-01-01
      • 2011-01-18
      • 2022-01-02
      • 2011-03-03
      相关资源
      最近更新 更多