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.
nonehover<a href="#">Try hovering over me!</a>
@media (hover: hover) {
a:hover {
background: yellow;
}
} | Specification | Status | Comment |
|---|---|---|
| Media Queries Level 4 The definition of 'hover' in that specification. | Candidate Recommendation | Initial definition. |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 38
|
12 | 64 | No | 28 | 9 |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | ? | 50 | 12 | 64 | 28 | 9.2 | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/@media/hover