0

How can i make a hyperlink of a ::after section in HTML, for example:

<span>This is an example</span>

span:after
{
     content: "...read more";
}

output will be:

This is an example...read more.

I want ...read more to be hyperlink. Is that possible?

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
tripleq
  • 89
  • 1
  • 1
  • 6

1 Answers1

3

No, it’s not possible. Generated content can only take the form of either static text or static image content, and not entire DOM elements.

Nor is this the kind of thing ::after is meant to be used for. There is no reason not to mark up a hyperlink within your document, since you're expressing a link between this document and some other document.

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356