Best practice for setting a href tag visited property default

155 Views Asked by At

I would like to override a href tag default's visited color property to inherit. However by making this change, every time I click on the link, it changes the color to its parent and not the one I set on it. To overcome this, I use a span to act as a parent element and set the color I want there. I would like to know if this is best practice or if there is any easier way to do it.

1

There are 1 best solutions below

0
Suraj-Ui On

After using text-decoration elememt it will show you same color after visit.

.a{
text-decoration: none;
}
<a href="www.google.com" class="a">Google</a>