JSFiddle - React, Tailwind, and code Playground
HTML
<div class="a">Sample Text1
<div class="b">Sample Text2</div>
<p>Sample Text3</p>
</div>
<div class="a b">Sample Text4</div>
CSS
body {
background-color: gray;
}
.a {
background-color:white;
}
.b {
background-color: black;
color: white;
}