【发布时间】:2011-02-09 14:47:24
【问题描述】:
我正在结合 ie7.js 脚本(启用 html5 样式支持)设置部分 HTML5 样式的页面。它在flawlessly 之前工作,但现在我使用相同的设置,website 出现在 IE6/7 中,没有样式。我已经忙了几天了,不知道为什么。任何人都能够找出问题所在?
这是我的头:
<!--[if lt IE 9]><script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script><![endif]-->
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="http://zzappservices.nl/wordpress/wp-content/themes/zzapp/style.css" />
<link rel="shortcut icon" type="image/x-icon" href="http://zzappservices.nl/wordpress/wp-content/themes/zzapp/favicon.ico" />
<!-- Scripts, CSS and settings specific targeted to Internet Explorer -->
<!--[if lt IE 9]><link rel="stylesheet" href="http://zzappservices.nl/wordpress/wp-content/themes/zzapp/css/ie.css" type="text/css" /><![endif]-->
<!--[if IE 6]><link rel="stylesheet" href="http://zzappservices.nl/wordpress/wp-content/themes/zzapp/css/ie6.css" type="text/css" /><![endif]-->
<!--[if IE]>
<link href="http://zzappservices.nl/wordpress/wp-content/themes/zzapp/css/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
<meta http-equiv="Page-Enter" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.0001)">
<meta http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.0001)">
<![endif]-->
该页面在 webkit/mozilla 浏览器中完美运行。
【问题讨论】:
-
它似乎阻塞了 style.css 中的声明:
@import url('css/layouts/1column.css') all; @import url('css/styling.css') all; @import url('css/print.css') print; @import url('extra.css') all;如果我直接链接这些样式表,它就可以工作(虽然布局很漂亮,但这就是我的预期)。有人知道为什么会这样吗? -
无论如何,我会放弃@import 方法,因为它显然会对性能产生负面影响:stackoverflow.com/questions/4801302/…。仍然想知道为什么 explorer 对此感到窒息......
-
在 IE 中,如果 @import 用于 CSS,样式表将在正文加载后包含,因此如果您的 JavaScript 依赖于定义的 CSS 类或样式,则可能会因此而失败.避免使用 @import 是个好主意。
标签: css html internet-explorer ie7.js