CSS content property: is it possible to insert HTML instead of Text?

Just wondering if it’s possible somehow to make the CSS content property insert html code instead string on :before or :after an element like: .header:before{ content: ‘<a href=”#top”>Back</a>’; } this would be quite handy…It could be done through Javascript but using css for this would really make lives easier 🙂 5 Answers 5

Can I use a :before or :after pseudo-element on an input field?

I am trying to use the :after CSS pseudo-element on an input field, but it does not work. If I use it with a span, it works OK. <style type=”text/css”> .mystyle:after {content:url(smiley.gif);} .mystyle {color:red;} </style> This works (puts the smiley after “buu!” and before “some more”) <span class=”mystyle”>buuu!</span>a some more This does not work – … Read more