简体   繁体   English

如何从CSS中排除类?

[英]How do I exclude a class from CSS?

I have the code: 我有代码:

.et_pb_text_inner a {
color: #fff;
}

If I want to exclude make sure this excludes ".et_pb_image_wrap", how would I do that? 如果要排除在外,请确保排除“ .et_pb_image_wrap”,我该怎么做?

So you're only wanting to apply the style if it also doesn't have that class? 所以,您只想在样式也没有该类的情况下应用样式?

.et_pb_text_inner:not(.et_pb_image_wrap) a {
color: #fff;
}

If .et_pb_text_inner a is affecting .et_pb_image_wrap then this is probably a matter of inheritance. 如果.et_pb_text_inner a影响.et_pb_image_wrap,则可能是继承问题。 A detailed writeup on inheritence in CSS may be found here . 有关CSS继承的详细说明,请参见此处

My guess would be to set 我的猜测是

.et_pb_image_wrap{
  color:revert;

}

Or 要么

.et_pb_image_wrap{
  color:initial;

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM