用的最多的就是 边框阴影(box-shadow)、圆角(border-radius)、渐变色(linear-gradient)
- 解决方案1:
在head中添加标记标签,强制IE使用高版本
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,11,10,9">
</head>
- 解决方案2:
使用官方脚本,统一处理css3不兼容IE8 及以下版本
div {
width: 500px;
height: 500px;
/* position: relative; */
/* z-index: 10; */
background: #eee;
box-shadow: 1px 1px 5px red;
behavior: url("./css/PIE.htc"); /* 兼容ie,加上这句 */
/*
需要有背景颜色,否则背景会变成阴影设置的颜色
必要时还需要添加定位(position)和层级(z-index)
定位选择相对定位和绝对定位即可
层级设置相对较高即可
*/
}