Is there any way to prevent the pseudo-element ::after
or ::before
from a <a>
link becoming part of the link itself?
My idea was to use ::after
in a <a>
link tag, this ::after
would be used to replace content from within the link itself that I do not want to show to the user, ::after
becomes part of the link itself, but I do not want this pseudo-element to have a link
In this example I put a text overwriting the name of the link, the text that is inside the tag <a>
, however this text remains clickable.
.link {
visibility: hidden;
position: relative;
}
.link:after {
visibility: visible;
content: 'Texto visível';
position: absolute;
left: 0;
top: 0;
}
<a href="www.google.com" class="link">google</a>
<a href="www.yahoo.com" class="link">yahoo</a>
<a href="www.terra.com">link real</a>
<a href="www.uol.com" class="link">uol</a>
How can I prevent this problem from the ::after
of the link becoming clickable?