The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Can you have HTML in a pseudo element?
I’m quite new to pseduo elements and am struggling to get it to render HTML. Can you not render HTML in a pseudo element as the browser just seems to print a string of text out to the page rather than rendering the element?
I’ve made a codepen here:
http://codepen.io/johnasp/pen/gBrdv
Simple answer….**NO**.
HTML is not allowed.
What are you trying to do?
Is it something like this: http://codepen.io/codegraphics/pen/zCnfH
Yes it is mate, that exactly what I was after! What’s going on there?
> Simple answer….NO.
There is no complicated answer. CSS cannot generate HTML.
> Yes it is mate, that exactly what I was after! What’s going on there?
Unicode. Alternatively you could use Icon fonts.