hover
CSS
media feature
can be used to test whether the user's
primary
input mechanism can hover over elements.
hover feature is specified as a keyword value chosen from the list below.
none
The primary input mechanism cannot hover at all or cannot conveniently hover (e.g., many mobile devices emulate hovering when the user performs an inconvenient long tap), or there is no primary pointing input mechanism.
hover
The primary input mechanism can conveniently hover over elements.
<a href="#">Try hovering over me!</a>
@media (hover: hover) {
a:hover {
background: yellow;
}
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
Media Queries Level 4
The definition of 'hover' in that specification. |
候选推荐 | 初始定义。 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
hover
media feature
|
Chrome
完整支持
38
注意事项
|
Edge 完整支持 12 | Firefox 完整支持 64 | IE 不支持 No | Opera 完整支持 28 | Safari 完整支持 9 |
WebView Android
完整支持
38
注意事项
|
Chrome Android 完整支持 50 | Firefox Android 完整支持 64 | Opera Android 完整支持 28 | Safari iOS 完整支持 9 | Samsung Internet Android 完整支持 5.0 |
完整支持
不支持
见实现注意事项。