html - CSS html * 除了一些类?

标签 html css

我想将其应用于除特定类及其子类之外的所有内容

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/

相关文章:

javascript - 小数位像素对齐问题

css - 计算高度和 child 边距的奇怪行为

html - 浏览器滚动条移位

javascript - 如何检测一个空的 div,然后使用 JS 或 css 插入一个 html 按钮

javascript - 如何使用 bootstrap 4 折叠中型屏幕的导航栏内容

HTML 电子邮件 - 带有 div 溢出的长文本不起作用

jQuery 获取以以下开头的类

html - 推特 Bootstrap : button with only icon inside input-append overflows past the input

html - 如何像表格一样对齐 flex 元素?

html - 如何在 html 列表中的文本后面添加箭头?