The any-hover CSS media feature can be used to test whether any available input mechanism can hover over elements.
The any-hover feature is specified as a keyword value chosen from the list below.
nonehover<a href="#">Try hovering over me!</a>
@media (any-hover: hover) {
a:hover {
background: yellow;
}
} | Specification | Status | Comment |
|---|---|---|
| Media Queries Level 4 The definition of 'any-hover' in that specification. | Candidate Recommendation | Initial definition. |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 41 | 16 | 64 | No | 28 | 9 |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | 41 | 41 | 16 | 64 | 28 | 9.2 | 5.0 |
© 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/any-hover