难道 HTML5 不应该在 IE9 中工作吗?它没有按我预期的那样工作。
这是我的 HTML5 代码:
<!DOCTYPE html>
<html>
<head><title>
Dripel - Welcome
</title>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<header>Welcome to Dripel</header>
<section id="main">
I am under development. Please check back later.
</section>
<footer>
</footer>
</body>
</html>
您可以在http://www.dripel.com/ 查看它.
在 IE 9 中,<header>
和 <section>
元素显示为内联。请注意,此时我没有使用任何 CSS。
知道发生了什么吗?
最佳答案
根据深入了解 HTML5,the final version of Internet Explorer 9 won’t have this problem .
所以我认为您看到这个是因为 IE9 仍处于测试阶段。没错,发布时你不应该看到它。
无论如何,为 HTML5 元素包含显式 display: block
可能是值得的。您(通常)永远不知道什么时候有人会在 HTML5 之前的浏览器中查看您的代码。
关于html - 为什么 IE9 将我的 HTML5 block 级元素显示为内联?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3766956/