pseudo-class
:hover — CSS reference
Matches an element designated by a pointing device. Touch behavior differs; never make essential information available only on hover.
Formal Syntax & Structure
css syntaxcss
:hoverWorking Example
Example Snippetcss
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Selector lab</title><style>:where(.sample) { color: rgb(32, 32, 32); }button:hover { color: rgb(0, 96, 80); }</style></head><body><button id="a" class="sample">A</button><button id="b" class="sample">B</button></body></html>