How can I delete a style entry stated in the main CSS-file in a media query CSS-file?
For example, I’d like to delete the a:hover entry for use on touch devices.
main.css: a:hover {color:#999999; background:#111111;}
How can I cancel this out in the media.css?
You can’t “delete” CSS rules.1 The cascade doesn’t work that way.
The only way to get your rule to apply only when the media query isn’t satisfied is to isolate it in a negated version of the query, either in a
@mediablock within your main.css stylesheet:Or in a separate stylesheet within your page head:
Alternatively you can undo the styles within your media.css stylesheet, but the downside to that is you must know what values to fall back to.
1 Except in a desktop browser’s developer tools, maybe.