纯CSS实现背景半透明文字不透明效果兼容IE6
脚本之家
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<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>