gpt4 book ai didi

css - 为页面的每个元素设置样式,但只有一个

转载 作者:行者123 更新时间:2023-11-28 07:18:38 25 4
gpt4 key购买 nike

我想为页面的每个元素设置样式,但特定的 div 除外。我相信这是用 :not 完成的,但我不确定。我这样做是为了使所有元素的不透明度为 0.7,弹出窗口除外。

最佳答案

这是我的替代建议:一个不透明的层在网络前面,但在叠加层后面。

这是一个例子:https://jsfiddle.net/j1jodsej/

HTML

<div id="overlaybg"></div>
<div id="overlay">
I'm the overlay
</div>

CSS

#content {
text-align: justify;
}
#overlaybg {
position: fixed;
z-index: 1;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(255,255,255,0.5);
}
#overlay {
position: fixed;
z-index: 2;
top: 30px;
background: #FFF;
text-align: center;
left: 50%;
width: 200px;
margin-left: -100px;
padding: 30px;
}

关于css - 为页面的每个元素设置样式,但只有一个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32216269/

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