Open this example in the interactive library
Source code
<fieldset
class="demo focus-within:[&_legend]:font-bold focus-within:[&_legend]:underline"
>
<legend>Pickup</legend>
<label>Date <input type="date" /></label>
</fieldset>
Focus within legend emphasis with Tailwind CSS 4 utilities. The preview uses precompiled styles.
Open this example in the interactive library
<fieldset
class="demo focus-within:[&_legend]:font-bold focus-within:[&_legend]:underline"
>
<legend>Pickup</legend>
<label>Date <input type="date" /></label>
</fieldset>