<p class="hovered"><a  href="https://peterlunch.com/remove-underline-from-link/" target="_blank">This is a link</a> that will underline when hovered.</p>

<p class="visited">This is a link that will underline once visited <a href="https://peterlunch.com/remove-underline-from-link/" target="-blank">link</a>.</p>
.hovered a:link, .hovered a:visited, .hovered a:active {
  text-decoration: none;

.hovered a:hover {text-decoration: underline;}
.visited a:visited {text-decoration: underline;}

.visited a:hover, .visited a:active {
  text-decoration: none;

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.