One modern CSS method would look like this:
:not(span) > p { background-color: aqua; }
<div>
<p>YES</p>
</div>
<div>
<span>
<p>NO, because it wrapped into <code>span</code> tag</p>
</span>
</div>
<div>
<div>
<p>YES</p>
</div>
</div>
<ul>
<li>
<p>YES</p>
</li>
</ul>
Run codeHide resultYour proposed solution ...
p:not(span p)
. , , - :not, CSS, . , . Selectors 4, . .
, :not - CSS- IE8 JS/jQuery. : : not() IE7/IE8