So I would like to achieve this in CSS only, since I know how simply it is to do in jQuery.
Basically, I have a long list of p and h4 elements, and I would like to style every last p element before the next h4. For example:
<h4>Heading</h4>
<p>Paragraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
<h4>Heading</h4>
<p>Paragraph</p>
<p>Paragraph</p>
<h4>Heading</h4>
<p>Paragraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
In that list, every last p needs to be styled before the following h4.
The amount of p and h4 tags on the page is always random.
Is something like this achieveable with CSS alone?