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
  • 37,291
  • 7
  • 81
  • 97
Chris W.
  • 22,835
  • 3
  • 60
  • 94
  • 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
  • 101,410
  • 14
  • 105
  • 129