你好,我有下面的代码,这只是一个例子,但解释了我的原理
<div class='main_content'>
<p>Hello</p>
<section>
<h6>Test Section</h6>
</section>
</div>
Hello 正在显示在 div 中并且正在分配空间但是内容不影响高度,(但是它显示在 div 中的 dom 树中)
有什么想法吗
最佳答案
为IE处理<section>
作为 block 级元素,您需要 html5 shiv hack:
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
http://code.google.com/p/html5shiv/
更多信息:
关于css - 浏览器无法识别 div 中的部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4511397/