Add TAG HTML with CSS content

2

Is it possible to add an HTML TAG using CSS content ?

#teste{
   content: "<p>tag HTML inserida via CSS</p>";
}
<div id="teste"></teste>
    
asked by anonymous 24.08.2016 / 23:41

2 answers

1

Using after or before you can add some content to your tag and style it but using tags within the content will be interpreted literally as text.

#teste:before{
content: "<a href='http://link.com'>Era pra ser um link</a>";
}
    
25.08.2016 / 07:30
0

As our friend Vitor André spoke, it will be really interpreted as text. Ideally, you should use jquery to do html injection on the page, using append or prepend.

    
02.09.2016 / 05:15