JSFiddle - React, Tailwind, and code Playground
by salsaproject
HTML
<div id="container">
<p>First</p>
<p>Second</p>
<p>Third</p>
</div>
CSS
/*this will turn the backgound-color to yellow only for the first P*/
p:first-child {
background-color: yellow;
}
/*this will turn the backgound-color to red only for the last P*/
p:last-child {
background-color: red;
}