【发布时间】:2015-09-12 22:21:57
【问题描述】:
我正在开发一个使用相当多的 ccs3 和 JS 的响应式站点,该站点有很多回退,因此它可以跨浏览器回到 IE8。对于几乎所有的 IE 版本,我在每个页面的 <head> 中都有这样的编写特定 IE 浏览器代码
<!--[if lte IE 8]>
<style>
/*CSS STYLES*/
</style>
<![endif]-->
<!--[if lt IE 8]>
<style>
/*CSS STYLES*/
</style>
<![endif]-->
除了这样做会占用每个页面的头部空间之外,还可以这样做:
<!--[if lte IE 9]>
<style>
/*Go to a style sheet where all the above code is*/
</style>
<![endif]-->
我在这里尝试做的是允许 IE 打开一个单独的样式表,其中包含所有 IE 浏览器的所有上述规则,而不是必须为 <head> 中的每个 if IE 块设置外部样式表
【问题讨论】:
标签: css internet-explorer cross-browser