gpt4 book ai didi

html - 有没有像:empty which matches if any children have display:none?这样的CSS选择器

转载 作者:行者123 更新时间:2023-11-28 12:22:35 24 4
gpt4 key购买 nike

正如标题所说,这个片段:

.group {
width: 100px;
height: 100px;
background-color: blue;
}

.group:empty {
background-color: red;
}

.hideme {
display: none;
}
<div class="group">
<div class="hideme">
hello
</div>
</div>

未能提供红色背景。是否有 :empty 的替代品,如果任何 child display:none 也匹配?

最佳答案

不幸的是,你不能单独使用 css 来实现它,但你可以使用 jquery 选择器 :visible 代替。

关于html - 有没有像:empty which matches if any children have display:none?这样的CSS选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18767344/

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