Basic exampleSection
by Dominik Wilk
HTML
<!-- Learn about this code on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/:last-child -->
<div>
<p class="x">This text isn't selected.</p>
<p class="x">This text is selected!</p>
</div>
<div>
<p>This text isn't selected.</p>
<h2>This text isn't selected: it's not a `p`.</h2>
</div>
CSS
.x:last-child {
color: lime;
background-color: black;
padding: 5px;
}