How can I select the last paragraph <p> element, if and only its the last and lowest HTML element of the <article> element?
I don't want to use .classes or #id's.
A CSS selector should automatically find and select the <p> element.
In my demo, in the first section, the last <p> element should be selected, while in the second section the last <p> element should not be selected.
Thank you for your directions.
article p:last-of-type{
background: yellow;
}
<article>
<column>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>This paragraph should <b>NOT</b> be selected, if this would be the last paragraph on a page.</p>
<div>Text</div>
<div>Text</div>
</column>
<hr>
<column>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>This paragraph <b>SHOULD</b> be selected, if this was the last paragraph on the page.</p>
</column>
</article>