JSFiddle - React, Tailwind, and code Playground
HTML
<div id="parent">
<div>
This image is inside a div.
<img src="http://www.placehold.it/100" alt="" />
</div>
<p>
And this inside a paragraph.
<img src="http://www.placehold.it/100" alt="" />
</p>
<img src="http://www.placehold.it/100" alt="" />
<img src="http://www.placehold.it/100" alt="" />
</div>
CSS
#parent > img {
border: 1px solid red;
}
#parent > img:first-child {
border: 1px solid blue;
}