我想将其应用于除特定类及其子类之外的所有内容
html * {
box-shadow: none !important;
border: none !important;
color: white;
}
我试过了但是不行
html *:not(.myclass *) {
box-shadow: none !important;
border: none !important;
color: white;
}
最佳答案
不是对你所问问题的直接回答,但可能有这个不是更好吗:
html * {
box-shadow: none;
border: none;
color: white;
}
然后在需要它的那些类中专门覆盖它,例如
.myclass {
color:blue;
}
这是您可能希望找到它的更多方式。请注意,我从第一个 * 说明符中删除了“重要”声明,因为这使得将来可能更难以覆盖。
关于html - CSS html * 除了一些类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57043320/