gpt4 book ai didi

css - 重叠 2 个 DIV 以显示颜色混合

转载 作者:太空宇宙 更新时间:2023-11-03 18:43:13 29 4
gpt4 key购买 nike

是否有可能看到这 2 个 DIV 的重叠显示如下

<div style="position:relative;margin-top:100px;width:500px;height:300px;">
<div style="background-color:rgba(23, 170, 180, 1);width:60px;height:145px;position:absolute;"></div>
<div style="background-color:rgba(249, 177, 67, 1);width:110px;height:70px;position:absolute;"></div>
</div>

即使它仅使用最新的 CSS3 甚至 -webkit- 属性也能正常工作。

最佳答案

试试这个,希望对你有帮助

<div style="position:relative;margin-top:100px;width:500px;height:300px;">
<div style="background-color:rgba(23, 170, 180, 1);width:60px;height:145px;position:absolute; z-index: 1;
opacity: 0.5; left: 25px;"></div>
<div style="background-color:rgba(249, 177, 67, 1);width:110px;height:70px;position:absolute;"></div>
</div>

看这个http://jsfiddle.net/xu8n5/1/

关于css - 重叠 2 个 DIV 以显示颜色混合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17063325/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com