JSFiddle - React, Tailwind, and code Playground
by Daniel Tan
HTML
<p id="loremIndexIpsum">This text should be red.</p>
<p id="loremAnotherIpsum">This text should be red too.</p>
<p id="loremIpsum">This text should also be red.</p>
<p id="anotherIdIpsum">But this text should not be red.</p>
<p id="loremSomethingElse">This text should not be red either.</p>
CSS
p[id^="lorem"][id$="Ipsum"]
{
color: red;
}
p::after
{
content: ' (#' attr(id) ')';
}