JSFiddle - React, Tailwind, and code Playground

HTML

<fieldset>
    <legend>THE TEXT</legend>
</fieldset>

CSS

legend {
    padding:0 14px;
}

legend::before {
    content:'BEFORE';
    color:red;
}