【问题标题】:Magento, CSS not rendering correctly on IE8Magento,CSS 无法在 IE8 上正确呈现
【发布时间】:2014-12-17 22:22:18
【问题描述】:

我是 magento 的新手,

我在 Magento 有一个项目,但它的布局在 IE8 中出现问题,

我试过了

 <!--[if IE 8]>
      .category-grid .item { 
           display:inline-block !important; 
      }
 <![endif]-->

这些代码在css文件中但是没有效果。

【问题讨论】:

    标签: php css magento internet-explorer-8


    【解决方案1】:

    CSS 样式应该写在&lt;style&gt; 标签中。像这样:

    <!--[if IE 8]>
      <style>
          .category-grid .item { 
              display:inline-block !important; 
          }
      </style>
    <![endif]-->
    

    【讨论】:

      【解决方案2】:

      如果您的 HTML 标记前没有 &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;,则 display:inline-block 在 IE8 中不起作用。

      【讨论】:

      • magento 默认提供 doctype 声明。没有必要改变它。
      • @ArunWilson 在下面查看我的答案。你忘记了&lt;style&gt; 标签。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-21
      • 1970-01-01
      • 2012-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多