是否有任何方法可以製作半透明重疊元素,從中只能看到更高的Z-index?我希望圖像對背景透明,而不是其他圖片。 Here是小提琴。對父項的透明度,但不是針對其他元素
body {
background: white;
}
section {
height: 400px;
position: relative;
perspective: 500px;
}
img {
height: 300px;
left: 50%;
margin: -100px;
position: absolute;
top: 40%;
transform: rotateY(-30deg);
width: 200px;
}
img:nth-child(1) {
left: 30%;
opacity: 0.8;
z-index: 3;
}
img:nth-child(2) {
left: 45%;
opacity: 0.4;
z-index: 2;
}
img:nth-child(3) {
left: 60%;
opacity: 0.2;
z-index: 1;
}
<section>
<img src="https://media4.s-nbcnews.com/j/newscms/2016_36/1685951/ss-160826-twip-05_8cf6d4cb83758449fd400c7c3d71aa1f.nbcnews-ux-2880-1000.jpg">
<img src="http://toprozdily.cz/wp-content/uploads/2015/04/slon-africky.jpg">
<img src="http://img.huffingtonpost.com/asset/,scalefit_950_800_noupscale/55fc14631c00004800082775.jpeg">
</section>
現在我們知道在哪裏,發佈圖片顯示它應該看起來像 – LGSon
順便說一句,這可能會有所幫助https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode ... https://css-tricks.com/almanac/properties/m/mix-blend-mode/ – LGSon