2

So I'm just trying to insert a link after some content but it just displays the literal string. How do I change this?

<p>Blah Blah Blah I'm some content</p>

CSS:

p:after {
    content: '- <a href="http://www.stackoverflow.com">Learn More</a>'
}

which produces of course the text:

<!-- language: lang-none -->

Blah Blah Blah I'm some content - <a href="http://www.stackoverflow.com">Learn More</a>

I expect the following output

Blah Blah Blah I'm some content - Learn More

Dunes
  • 34,599
  • 7
  • 78
  • 91
Chris W.
  • 21,954
  • 3
  • 54
  • 92
  • possible duplicate of [Can you use the :after pseudo element to add html?](http://stackoverflow.com/questions/1672879/can-you-use-the-after-pseudo-element-to-add-html) – Ulrich Schwarz Jun 27 '14 at 16:47

1 Answers1

1

You need javaScript for this kind of things.

It can easily be done with jQuery. DEMO

HTML

<p id="p">Blah Blah Blah I'm some content</p>

jQuery

var plink ='- <a href="http://www.stackoverflow.com">Learn More</a>';
$('#p').append(plink);
G-Cyrillus
  • 94,270
  • 13
  • 95
  • 118