KandZ – Tuts

We like to help…!

CSS 31 💻 any-hover and any-pointer media features

a -  any-hover media feature

any-hover can be used to detect whether a pointing device(mouse) can hover over elements
values: none → there is no pointing device that can hover
hover → pointing device that can hover
syntax → any-hover: none | hover;
Desktop browsers have a pointing device
Mobile browsers with touch input, there might be no any hover effect
@media (any-hover: none) → applies to devices with no hover effect


b - any-pointer media feature

any-pointer can be used to detect whether a pointing device is available
Such devices are a mouse or a touch screen
values: none → no pointing device are available
coarse → pointing device with limited accuracy
fine → pointing device with fine accuracy
Desktop browsers have a pointing device
Mobile browsers with touch input, there might be no any pointer available
@media (any-pointer: none) → applies if no pointing device is available

Leave a Reply