I am trying to add metadata to html, and show link from ::before {} element.
<div>
lorem
<span data-discussion="https://stackoverflow.com/questions/19826249/html-link-correct-placement>
ipsum
</span>
<div>
[data-discussion]:hover::before{
background: pink;
content: attr(data-discussion);
/* link be here! */
}
The ::before
attribute is really convenient, as I am able to apply it to the whole page without rewriting my html.
Is there a way to add href-like link to it?