纯CSS完成情况半全透明文本不全透明实际效果适

2021-01-20 11:15 jianzhan

拷贝编码
编码以下:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF⑻">
<title>
IE情况半全透明
</title>
<style type="text/css">
.alpha{
width: 100px;
height: 100px;
color: #fff;
background: rgba(0, 0, 0, .3);
filter: progid:DXImageTransform.Microsoft.gradient(gradientType = 0, startColorstr = #50000000, endColorstr = #50000000)\9;
}
:root .alpha{
filter: none; /*for IE9*/
}
</style>
</head>
<body>
<div class="alpha">
文本文本
</div>
</body>
</html>