Is there a way to target only the <p>
tags that come after the first 3 <h2>
tags in CSS?
I want to style the "one", "two", and "three" text as red, but not affect the "four" and "five" text.
Below is an example of my code, but I'm unsure what the correct CSS selector should be:
.container h2 + p {
color: red
}
<div class="container">
<h2>Some text</h2>
<p>One</p>
<h2>Some text</h2>
<p>Two</p>
<p>Two</p>
<h2>Some text</h2>
<p>Three</p>
<p>Three</p>
<p>Three</p>
<h2>Some text</h2>
<p>Four</p>
<p>Four</p>
<p>Four</p>
<p>Four</p>
<h2>Some text</h2>
<p>Five</p>
<p>Five</p>
<p>Five</p>
<p>Five</p>
<p>Five</p>
</div>