我有一个父DIV:如何制作小孩DIV从图像上的透明色40%的父母上移除颜色透明度?
background-image: url('img.jpg'); background-color: rgba(0,0,0,0.4);
和一个孩子的div:
width: 400px; height: 400px;
如何让孩子DIV显示父母的背景图像的一部分,没有黑色透明度?
.parent {
width: 500px;
height: 500px;
background: url('http://i.imgur.com/Y6a49hy.png');
}
.child {
background-color: rgba(0, 0, 0, 0.7);
width: 100%;
height: 100%;
}
.non-shadowed-div {
width: 300px;
height: 300px;
}
<div class="parent">
<div class="child">
<div class="non-shadowed-div">
This div shouldn't be shadowed like the rest of the square
</div>
</div>
</div>
创建 –
https://jsfiddle.net/zjq48qsx/1/这里是我的问题 – doobeedoo