<div class="box">文字不透明,背景透明</div>
<style>
*{
padding:0;
margin:0;
}
.box{
background:rgba(255,0,0,0.5);
filter:progid:DXImageTransform.Microsoft.gradient(startcolorstr=#FF8080,endcolorstr=#FF8080);/*此时的值为半透明效果后的颜色值*/
height:200px;
color:#fff;
line-height: 200px;
}
</style>
时间: 2024-11-05 14:48:47