gpt4 book ai didi

javascript - 父对象的 CSS 不透明度

转载 作者:行者123 更新时间:2023-11-30 09:04:13 25 4
gpt4 key购买 nike

您好,我想制作一个弹出窗口,使背景具有 80% 的不透明度,但内部子对象不继承此属性并保持 100% 不透明和可见。我将如何编写 css 或 javascript 脚本来使它出现?像这样的东西:


<div style=opacity:80>
<div style=opacity:100>
I want to make this text to not be partially transparent due from style inheritance
</div>
</div>



有什么想法吗?提前感谢您的帮助

干杯

最佳答案

这个有效:

<div style='position:relative;width:WWW; height:HHH;'>
<div style='opacity:80; position:absolute; top:0; left:0; width:WWW; height:HHH;'> <!-- cover -->
<div>
I want to make this text to not be partially transparent due from style inheritance
</div>
</div>

关于javascript - 父对象的 CSS 不透明度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6484220/

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