填充在使用< section>时不工作。标签 [英] Padding not working when using <section> tag in IE
问题描述
我使用HTML5< section> tag in my application,padding for<部分>标签工作正常在chrome,ff和safari,但它不工作在IE ..
I am using HTML5 < section > tag in my application, padding for < section > tag works fine in chrome,ff and safari but its not working in IE..
我试图添加display:block;
I tried adding display:block; with the section style but its not useful...
推荐答案
许多旧版本的浏览器不了解节
等HTML5标记,并使用将其作为文档流中的内联项处理的备用。
Many older browsers don't understand HTML5 tags like section
and use the fallback of treating them as inline items in the flow of the document.
IE超越了这一点,完全忽略了HTML5标签。要解决此问题,您需要通过Javascript将标记添加到文档。幸运的是,有一个非常漂亮的HTML5Shiv,你可以嵌入你的html的头部像这样:
IE goes a step beyond this and totally ignores HTML5 tags. To fix this, you'll need to add the tags to the document via Javascript. Fortunately, there's a very nice HTML5Shiv that you can embed in the head of your html like so:
<!DOCTYPE html>
<head>
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
任何小于IE9的IE都将使用此脚本启用常见的HTML5块。
Any IE less than IE9 will now use this script to enable the common HTML5 blocks.
您仍然需要使用CSS使标签显示为块。我使用:
You will still need to use CSS to make the tags display as blocks. I use:
article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
display:block;
}
这篇关于填充在使用< section>时不工作。标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!