如何让IE浏览器也支持html5 ?下面介绍两个方法,在页面脚本head中添加以下其中一种脚本即可。
1.
<!–[if lt IE 9]>
<script type=”text/javascript”>
</script>
< ![endif]–>
2.
<!–[if IE]>
<script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”></script>
<![endif]–>
<script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”></script>
<![endif]–>
第二种脚本需要打开google的链接,这会影响页面打开速度,因此可参考第一种脚本。
这就减少了http请求。IE浏览器在默认情况下这些标签表现为内联元素,因此要对这些标签进行布局需要利用CSS手工把它们转为块状元素。
定义一下CSS代码
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {display:block;}