189 8069 5689

html5兼容ie,浏览器css3兼容

怎么让ie浏览器支持html5

让ie浏览器支持html5标签

建邺网站建设公司成都创新互联,建邺网站设计制作,有大型网站制作公司丰富经验。已为建邺上千提供企业网站建设服务。企业网站搭建\外贸网站建设要多少钱,请找那个售后服务好的建邺做网站的公司定做!

HTML5出现也不短了,很多网站的页面都进行了改版,为了降低代码量(不需要起太多的类名),提升加载速度,提高标签的语义性,因此,在网页中大量使用了section,article,header等HTML5标签。自己最近在写响应式布局的范例,里面也使用到了header等标签。还是比较希望能够做成兼容“旧版浏览器”的,在此和大家共享一下,如何让旧浏览器支持HTML5新增标签。

HTML5 新标签兼容旧版本浏览器的方法

如何解决HTML5在老版本IE下的兼容性

HTML5兼容低版本的浏览器:

在JS代码中加入

1. script type="text/javascript"document.createElement('header');

2. document.createElement('nav');

3. document.createElement('figcaption');

4. document.createElement('figure');

5. document.createElement('section');

6. document.createElement('article');

7. document.createElement('aside');

8. document.createElement('footer');/script

或者:

1. script type="text/javascript"(function(){var e="abbr,article,aside,audio,canvas,datalist,details,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i]);}}());/script

或者下载Google的html5兼容性js,最好下载到本地用

1. script type="text/javascript" src=""/script

怎么用html5制作网页,怎么让IE8兼容html5

itjob老师教过为了方便兼容IE8中使用HTML5,可以使用JS的方法来使低于IE9版本的IE浏览器兼容。

!--[if lt IE 9]

script

(function(){

var tags = ['header','footer','figure','figcaption','details','summary','hgroup','nav','aside','article','section','mark','abbr','meter','output','progress','time','video','audio','canvas','dialog'];

for(var i=tags.length - 1;i-1;i--){ document.createElement(tags[i]);}

})();

/script

![endif]--

第二种方法:使用Google的html5shiv包


分享题目:html5兼容ie,浏览器css3兼容
本文URL:http://cdxtjz.cn/article/dsdehed.html

其他资讯