-1

For any text and underline, we can use line-height and padding-bottom. But in my case i have used hyperlinks, so when i hover over the hyperlink i want the text-decoration underline to increase the spacing between the hyperlink text and underline?

looking forwards for some answers for this.

1 Answers1

0

As you can see in the below snippet,

I created a custom link with the way you were looking for, check it out and let me know in case if you require further assistance.

.custom {
  text-decoration: none;
  display: inline-block;
  position: relative;
}

.custom::after {
  content: '';
  display: inline-block;
  width: 100%;
  left: 0;
  height: 1px;
  position:absolute;
  background-color: rgb(0, 0, 238);
  bottom: -2px;
}
<h2>Normal Link</h2>
<a href="google.com">Hello</a>
<h2>Custom Link</h2>
<a href="google.com" class='custom'>Hello</a>
Abin Thaha
  • 4,493
  • 3
  • 13
  • 41