h5和css3兼容IE8浏览器

时间:2022-08-26 15:07:42

一、兼容html5标签

使用html5.js来兼容。
百度云盘下载:html5.js

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>html5.js</title>
<!-- 条件引入html5.js -->
<!--[if lt IE 9]>
<script src="js/html5.js"></script>
<![endif]-->

</head>
<body>

二、兼容css3 属性

2.1 使用ie-css3.htc来实现,不过该文件在IE9里会报错。
百度云盘下载:ie-css3.htc

.border{
border-radius:10px;
margin:50px;
width:200px;
height:200px;
border: 1px solid #ccc;
background:#fff;
box-shadow: 3px 3px 10px #f00;
text-shadow:20px 20px 1px #555;
behavior: url(css/ie-css3.htc); /*括号里的路径写绝对路径*/
}

使用参考网址:
1、让ie6ie7ie8浏览器支持css3属性
2、IE6&7下使用CSS3(ie-css3.htc的使用及加强版)

2.2 使用CSS3-PIE
使用参考网址:PIE使IE支持CSS3圆角盒阴影与渐变渲染