Lesson 28 of 3093%
(Progress persistence is disabled until Phase 9)
Tailwind CSS
Beginner
Hover and Focus States
Styling elements on interaction.
You can apply classes conditionally when an element is hovered or focused using prefixes.
hover:focus:
<button class="bg-blue-500 hover:bg-blue-700 text-white px-4 py-2 rounded transition-colors">
Hover me
</button>
Tip: Using transition-colors makes the background change smoothly!