<h1>
  Testing Media Features for pointer and hover
</h1>
<p>
  View this demo using different devices.
</p>
<div class="desc"></div>
/* Copyright 2020 Google LLC.
SPDX-License-Identifier: Apache-2.0 */

/* CSS files add styling rules to your content */

body {
  font-family: "Benton Sans", "Helvetica Neue", helvetica, arial, sans-serif;
  margin: 2em;
}

.desc {
  color: #ccc;
  background-color: rgba(0, 0, 0, 0.9);
  border-radius: 4px;
  padding: 10px;
}

@media (hover: hover) {
  .desc::before {
    content: "Your device allows you to hover.";
  }
}

@media (hover: none) {
  .desc::before {
    content: "Your device does not allow you to hover.";
  }
}

@media (pointer: fine) {
  .desc::after {
    content: " You are using a fine pointer, a mouse or trackpad perhaps?";
  }
}

@media (pointer: coarse) {
  .desc::before {
    content: "You are using a touchscreen and reporting a coarse pointer.";
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.