css - 浏览器无法识别 div 中的部分

标签 css html

你好,我有下面的代码,这只是一个例子,但解释了我的原理

<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/

相关文章:

javascript - 如何在页面加载时显示运行进度条

css子最大深度选择器

html - 一张图片在 Android、IE7、IE8 中不显示,其他地方都很好

javascript - onclick:改变位置后做一些事情

javascript - 使用 jQuery 将图片从一个 div 添加到另一个

PHP函数将SQL作为html返回并抛出错误?

jquery - 如何滚动到下一篇具有相同类别的文章

javascript - 通过 "request.querystring"从包含的 html 文件中检索参数

javascript - JQuery/Javascript : Getting locally changed booleans

jquery - 如何检查元素在我的案例中是否可见?