Add HTML TAG with CSS content

Asked

Viewed 971 times

2

You can add an HTML TAG via CSS content?

#teste{
   content: "<p>tag HTML inserida via CSS</p>";
}
<div id="teste"></teste>

2 answers

1

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

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

0

As our friend Vitor André said, it will really be interpreted as a text. The ideal is to use jquery to make html injection on the page, using "append" or "prepend".

Browser other questions tagged

You are not signed in. Login or sign up in order to post.