Reputation: 36309
I want to differentiate styling based on whether the client browser supports hovering or not. I read that media features would do the job and so I used the following structure:
/* Supports hovering */
@media (hover: hover) { ... }
/* Does not support hovering */
@media (hover: none) { ... }
While this works fine on Chrome (see specs below), on Firefox I get the error Expected media feature name but found ‘hover’
. I am surprised, especially because it was developer.mozilla.org where I read about using hover
as a media feature.
Is there anything I need to do in addition to get this working on Firefox?
For example this example about hover
as a media feature doesn't work for me on Firefox while it does on Chrome.
Chrome: Version 67.0.3396.79 (Official Build) (64-bit)
Firefox: 60.0.2 (64-bit)
Upvotes: 2
Views: 1041
Reputation: 18423
This media feature is only available for Firefox version >= 64:
https://developer.mozilla.org/en-US/docs/Web/CSS/@media/hover#Browser_compatibility
Upvotes: 1