Open this example in the interactive library
Source code
<p class="demo selection:bg-amber-200 selection:text-amber-950">
Select a few words in this sentence.
</p>
Highlight text selection with Tailwind CSS 4 utilities. The preview uses precompiled styles.
Open this example in the interactive library
<p class="demo selection:bg-amber-200 selection:text-amber-950">
Select a few words in this sentence.
</p>