更新时间:2023-12-05 10:31:58
是否有某种方法可以执行此操作
Is there a certain way to do this
如果选择器匹配,则无法停止应用于元素的规则
There is no way to stop rules applying to an element if the selector matches.
您可以
!important
!important
除了获取所有计算的样式列表并将它们设置为空以外吗?
other than getting the list of all computed styles and setting them empty?
这不会工作。大多数属性不接受空白值,因此规则将无效并被忽略(从而导致之前的规则再次应用)。
That wouldn't work. Most properties won't accept a blank value, so the rule would be invalid and ignored (thus causing the previous rule to apply again).