这是我的代码,正如你所看到的机体有一些背景图像,并且#cont应该是白色的。但我希望我的div元素透明,可以看到身体背景图像。任何可以做到这一点的CSS技巧?CSS背景切割
body {
margin: 0;
border: 0;
padding: 0;
height: 100%;
width: 100%;
background-image: url(image.png);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#cont {
margin: 0;
border: 0;
padding: 0;
background-color: white;
}
#cont div {
margin: 20px;
border: 1px solid gray;
padding: 0;
width: 50px;
height: 50px;
float: left;
}
<div id="cont">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
你拨弄不显示问题。 –
将image.png添加为链接,以便我们可以看到它。 –
我知道,但我不希望我的div元素像#cont背景那样变白。我希望他们能够“剪切”白色背景并显示身体背景图像 –