JSFiddle - React, Tailwind, and code Playground

by karthick6891

HTML

<!-- nth-child and nth-last-child, nth-child from top nth-last-child from bottom-->
<div class="wrapper">
    <div class="one">one one one one one one one one one one one one one one one one one one one one one</div>
    <div class="two">two two two two two two</div>
    <div class="three">three</div>
    <div class="four">four</div>
</div>

CSS

div:nth-child(1):nth-last-child(4){
    background-color: green;
}