LogotailboostbyAvatar@SRuhleder

Hover

Tailwind provides a wide variety of modifiers that control when a utility class is applied.

One of the most helpful modifiers in Tailwind's toolbelt is hover:. When you prefix a utility class with the hover: modifier, it is only applied when the user hovers over the element.

For example, hover:bg-red-500 applies the bg-red-500 utility class only when the user hovers over the element.

Set the background color of the button to gray-700 on hover.

<button class="text-white px-4 py-2 rounded-md bg-gray-800 ">
  Hello, world!
</button>
Live Preview