我想选择所有不遵循 H3 或 P 的 P 所以:
<img>
<p> this is selected</p>
<p> this is not</p>
<p> this is not</p>
<span>
<p> this is selected</p>
<h3>
<p> this is not</p>
我试过
p + :not(h3, p) and :not(h3, p) + p
但他们不工作
解决办法是什么?请帮忙
我想选择所有不遵循 H3 或 P 的 P 所以:
<img>
<p> this is selected</p>
<p> this is not</p>
<p> this is not</p>
<span>
<p> this is selected</p>
<h3>
<p> this is not</p>
我试过
p + :not(h3, p) and :not(h3, p) + p
但他们不工作
解决办法是什么?请帮忙
:not(h3):not(p) + p {
...
}
</p>
使用这样的类...
<img>
<p class="sel"> this is selected</p>
<p> this is not</p>
<p> this is not</p>
<span>
<p class="sel"> this is selected</p>
<h3>
<p> this is not</p>
然后在你的CSS中你可以修改它们......
.sel {
/* Styling here */
}