https://codepen.io/bazzle/pen/jyWdjM
I want to select the first p
but not the p
nested inside blockquote, or any other element.
In other words the first p
out of all the child p
's but not grandchild p
's
<div class="article__body">
<p>
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
</p>
<blockquote>
<p>
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
</p>
</blockquote>
<p>
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
</p>
</div>
CSS (less)
.article__body{
p:first-of-type{
background-color:green;
}
}