I'm trying to target some headers except those within a particular parent element. When I apply the styles below to the (abstracted) HTML below, the font size of both headers is impacted. What do I have wrong with the :not
selector?
In this scenario I'm not able to modify the CSS selectors but need to make sure the HTML is crafted such that the selectors work as expected.
:not(#beginning) h4.small {
font-size: .25rem;
}
<div id="beginning">
<h4 class="small">Unaffected header</h4>
</div>
<div id="end">
<h4 class="small">Affected header</h4>
</div>