We can use hover
modifier to style the element when hovered.
Version
TailwindCSS 3.0
hover
The hyperlink is red when hovered.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
<title>TailwindCSS</title>
</head>
<body>
<a class="hover:text-red-500" href="#">My Blog</a>
</body>
Line 10
<a class="hover:text-red-500" href="#">My Blog</a>
hover
: style the element when hovered
Conclusion
hover
modifier is not only used on<a>
, but also other element