<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>:focus-visible example</title>
</head>
<body>
  <div class="card">
    <h1 class="card__heading" tabindex="0">
      I will be focused by tab key.
    </h1> 
  </div>
</body>
</html>
.card__heading:focus {
  outline: none;
/*   outline: 1px solid red; */
}
.card__heading:focus-visible {
  outline: 1px solid red;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.