18910140161

HTML-如何针对除某些类以外的整个主体?:不是没有工作?角度-堆栈溢出

顺晟科技

2022-10-18 13:55:47

137

我想瞄准身体里的所有东西,除了两个类。

<代码>正文{背景:灰色;}

我正在尝试:

<代码>正文:非(.MyCustomClassWhereIsBackgroundWhite){背景:白色;}

我的角度组件配置文件:

<代码><;DIV类=";MyCustomClassWhereisBackgroundWhite";>;...其他上下文<;/DIV>;

在此组件不受影响背景:白色;

这不是工作吗?请给我提供一些解决方案。我想要一些类改变而不是背景灰色。


顺晟科技:

body { background: gray; } 目标body:not(.myCustomClassWhereIsBackgroundWhite) { background: white; } 元素,这些元素没有类<div class="myCustomClassWhereIsBackgroundWhite"> ...other context </div> 中的元素,则必须添加一个空格。

body:not(.myCustomClassWhereIsBackgroundWhite)

<代码>正文{背景:灰色;}正文:非(.MyCustomClassWhereIsBackgroundWhite){背景:白色;}
<代码><;DIV Class=“ MyCustomClassWhereisBackgroundWhite ”>;...其他上下文<;/DIV>;<;细分(>;)其他一些元素<;/DIV>;

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航