score:0

what about overlaying your link instead of wrapping it around the other html?

something like:

.container {
  position: relative;
}

.link {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  transition: 1s background-color;
}

.link:hover {
  background-color: rgba(0, 0, 200, 0.2);
}
<div class=container>
  <a class=link href="goes-somewhere"></a>
  <div class=markdown>
    <h1>my markdown</h1>
    <a class=some-other-link href="goes-somewhere-else">this one is in the document</a>
  </div>
</div>


Related Query

More Query from same tag