This is a pretty simple question that I can't quite get my head around.
I have a series of divs like this:
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<p>Paragraph text</p>
<h2>Heading 3</h2>
<p>Paragraph text</p>
In CSS I can target h2 tags that follow from h1 tags with: h1+h2{}
, however I can't seem to use :not()
in this way. For example, I'd like to use:
#text h2:not(h1+h2){
margin-top:3em;
}
But this doesn't seem to work. Am I doing some sort of stupid syntax error or is this not possible to do?