files/en-us/web/css/reference/at-rules/@media/hover/index.md
The hover CSS media feature can be used to test whether the user's primary input mechanism can hover over elements.
The hover feature is specified as a keyword value chosen from the list below.
none
hover
<a href="#">Try hovering over me!</a>
/* default hover effect */
a:hover {
color: black;
background: yellow;
}
@media (hover: hover) {
/* when hover is supported */
a:hover {
color: white;
background: black;
}
}
{{EmbedLiveSample("Examples")}}
{{Specifications}}
{{Compat}}