我有一个 div,它是 mask 。第二个 div 应该被切割成透明的 mask 。如果背景颜色是绿色,那么div应该是绿色
<body style="background:green;">
<div style="position:fixed;width:100%;height:100%;background:red;z-index:501;"></div>
<div style="width:500px;height:500px;background:blue;position:absolute;z-index:502;"></div>
<!-- I want to make the second div in the body-color that is the green color -->
你能以某种方式帮助我吗?谢谢。 http://jsfiddle.net/RYKFQ/2/
最佳答案
怎么样:在第二个 Div 中根据需要设置颜色的不透明度。围绕不透明度进行调整以获得所需的 mask 效果。将第二个 div 放在具有您想要的背景颜色的父 DIV 中。可能是以下 fiddle 可能对您有所帮助。祝你好运!
关于css - div切入面具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10619561/