:hover
:hover is a CSS pseudo-class in the Pseudo-classes category. Applies styles when the user hovers over an element with a pointing device. The syntax is :hover. A typical example: a:hover { color: red; } It is commonly applied to markup such as <div class="demo">Sample</div> Browser support: Chrome 1+, Firefox 1+, Safari 1+, Edge 12+. A close relative is :focus, which applies styles when an element has received focus. A close relative is :active, which applies styles while an element is being activated (clicked). A close relative is :visited, which applies styles to links that have been visited. More about this category: CSS pseudo-classes for targeting elements based on state or position. Related Pseudo-classes entries: :focus, :active, :visited, :link, :focus-within, :focus-visible, :target, :enabled. This page is part of the free CSS Reference documentation covering 841+ properties, selectors, functions, and at-rules, each with syntax, values, examples, and browser support.