以下是我尝试过的代码
HTML
<div>
<span>Span1</span>
<span>Span12</span>
<span>Span13</span>
</div>
<div>
<span>Span1</span>
<span>Span12</span>
<span>Span13</span>
</div>
<span>Span2</span>
<span>Span3</span>
CSS
:not(div>span)
{
color : #ff0000;
}
我希望跨度span2
和span3
使用非选择器为红色
检查 Js 小提琴