Reputation: 10643
I want to select all P's which do not follow a H3 or a P so:
<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>
I tried
p + :not(h3, p) and :not(h3, p) + p
but they do not work
what is the solution? Please help
Upvotes: 5
Views: 2051
Reputation: 50643
You can express that, as css selector, this way:
*:not(h3):not(p) + p
See working demo
Upvotes: 5
Reputation: 1959
Use classes like this...
<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>
Then in your CSS you can modify them with...
.sel {
/* Styling here */
}
Upvotes: -2