<h1>Background will be red if device can hover or blue if no hover available.</h1>
<p><a href="#">Testing hover</a></p>
h1 {
  background: blue;
  text-align: center;
  color: #f9f9f9;
}
@media (any-hover: hover) {
  h1 {
    background: red;
  }
  a:hover {
    background: yellow;
  }
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.