Tom Blog

opacity兼容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
.box{
width:740px;
height:560px;
background: rgba(0, 0, 0, 0.95);
//#4c000000 f2 就是下边console的结果
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#f2000000', EndColorStr='#f2000000');
}
:root .box {
filter: none;
}
//0.95 就是透明度
console.log(Math.floor(0.95 * 255).toString(16));