Is there a way to select the very last child of an element and apply a specific class without using nesting?
For instance, how can I target only the final div in the structure below, nothing more and nothing less.
<body>
<div class="very-last-child">
<p>The first paragraph.</p>
<p>The second paragraph.</p>
<p>The third paragraph.</p>
<p>The fourth paragraph.</p>
<div class="select-me">
<p>The first paragraph.</p>
<p>The second paragraph.</p>
<p>The third paragraph.</p>
<p>The fourth paragraph.</p>
</div>
</div>
</body>
I have attempted a similar approach before but it did not yield the desired result.
div > :last-of-type {
padding-bottom: 50px;
}
p, div{
border: 2px solid black;
}
SCENARIO: How can I add padding to the last element within my page wrapper, regardless of its type? Note that I am working with SCSS.