body{
background:url('
3D2048/sign=5f1e851cd60735fa91f049b9aa690fb3/f703738da9773912471da266fa198618367ae2fa.jpg');
}
.div1{
position:relative;
padding:100px;
width:200px;
height:200px;
}
/**/
.opaticy{
position:absolute;
top:0px;
left:0px;
z-index:10;
width:100%;
height:100%;
opacity:0.5;
background:#fff;
}
.div2{
position:relative;
z-index:15;
width:200px;
height:200px;
background:red;
}
做的一个小例子,原理是用另外一个层来填充整个div来当作透明; 希望可以帮到你 望采纳~~