<div class="header">
<span class= "text">
<span class="icon disable">
::before
</span>
<span>
::after
</div>
我要添加CSS属性背景:透明的伪类::与类名“文本”跨度后,通过检查它的子范围有类名“禁用”。如何通过检查其子CSS属性添加到元素的伪类有特定的类名
请检查图片了解我的要求给我任何解决方案。是否有可能在CSS中做到这一点?
我试了很多个小时..请帮帮我! 在此先感谢.......... described in image
你可以使用jQery的hasClass()方法https://api.jquery.com/hasclass/。 ($''text')。hasClass('disable')如果它返回true(元素具有禁用类)比$('yourelemnent')。css('add ur css prpoerty') 。 – LogicBlower