几天来,我一直在努力让我的网站在 IE8 上看起来正确(因为愚蠢的银行没有更新他们的浏览器),我已经缩小了一点。
我正在使用 HTML5 标签(IE8 不支持),因为我无法忍受不必要的 div 汤。我正在使用著名的 HTML5shiv 来获取 HTML 元素section
,并article
在 IE8 中工作。不过,对于这些标记名,IE8 似乎仍然不可靠。
这是一个例子:
<html>
<head>
<title>ie8</title>
<script id="html5shiv_script">/*blah blah*/</script>
<style>
section{display:block;}
article{display:block;background:green;}
article.first + article{font-size:72px;}
article.first{color:yellow;}
article:first-child{background:blue;}
</style>
</head>
<body>
<section>
<article class="first">One</article>
<article>Two</article>
<article>Three</article>
<article>Four</article>
<article>Five</article>
</section>
</body>
</html>
链接:http ://www.webnotes.xyz/ie8.html
我找不到任何关于为什么这两种样式没有在 IE8 中应用的任何信息:
article.first + article{font-size:72px;}
article:first-child{background:blue;}
我无法从中推断出任何东西,因为 IE8 应该支持这些选择器,并且在我的个人网站中,我用类切换了这些选择器,但它仍然无法工作。
我通过谷歌搜索找不到任何关于此的信息。谁能解释为什么这些样式在 IE8 中被忽略了?
重要编辑:我刚刚意识到这在 IE9 中也不起作用。