简体   繁体   English

页眉/页脚/导航标签-在IE7,IE8和浏览器中,不支持HTML5的标签会发生什么变化?

[英]header/footer/nav tags - what happens to these in IE7, IE8 and browsers than don't support HTML5?

I am eager to start using Html5 in particular the <header>/<footer>/<article>/<nav> tags. 我渴望开始使用Html5,尤其是<header>/<footer>/<article>/<nav>标签。

What happens if the browser doesn't support these? 如果浏览器不支持这些怎么办?

Also I need to style these so: For Example: The nav has borders and margins etc. You know standard CSS stuff. 我还需要设置样式:例如: nav具有边框和边距等。您知道标准的CSS知识。

So if I style them using the nav tag then IE7 & IE8 etc are going to ignore this? 因此,如果我使用nav标签对它们进行样式设置,则IE7和IE8等将忽略这一点?

Place this is the <head> section of your page, before any CSS files are loaded. 在加载任何CSS文件之前,将其放置在页面的<head>部分中。

<!--[if lte IE 8]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->

html5shi(m|v) creates doc elements for all the html5 elements so the styles from your CSS can kick in. Default behaviour for IE is to ignore unknown elements. html5shi(m | v)为所有html5元素创建doc元素,以便可以插入CSS样式。IE的默认行为是忽略未知元素。 For more info see resig's blog post . 有关更多信息,请参见resig的博客文章

Yes, IE<9 will ignore any HTML5 elements (reason #3162 no one should ever have used IE) but there are javascript solutions for that which my groggy mind can't think of this morning. 是的,IE <9将忽略任何HTML5元素(原因#3162,没有人应该使用IE),但是有一些JavaScript解决方案可以解决我今天心情不佳的问题。 I'm sure others will post those solutions below. 我确定其他人会在下面发布这些解决方案。 :) :)

First is the html5 shiv 首先是html5 shiv

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM