:hover
W3C CSS Snapshot 2026
Match an element while a pointing device points at it.
On this page
Syntax and values
| Value or syntax | What it does |
|---|---|
button:hover | Matches a button while it is hovered. Touch devices can handle this state differently. |
Try the example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>:hover</title>
<style>
button:hover { background: teal; color: white; }
</style>
</head>
<body>
<button type="button">Open schedule</button>
<button type="button" disabled>Unavailable</button>
</body>
</html>
What to expect Move the pointer over a button to see its background change.