<h2>
  <a href="#">Hover over me</a>
</h2>
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #ff6361;
  color: #fff;
  font-family: "Fira Sans"
}

a {
  text-decoration: none;
  color: inherit;
}

a:after {
  content: "";
  display: block;
  width: 0;
  height: 2px;
  background-color: #fff;
  transition: width .3s;
}

a:hover:after {
  width: 100%;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.