is there any CSS way to add div, p, span elements inside css content attribute? I mean code like this
.textblockquote:before{
content: "<span class='green'>“</span>";
}
is there any CSS way to add div, p, span elements inside css content attribute? I mean code like this
.textblockquote:before{
content: "<span class='green'>“</span>";
}
No, CSS is all about styling, not adding code. You might be able to workaround this, but it's very bad practice.
It will probably be easier to achieve the requested effect or design in another way.
You can achive this with hexadecimal characters, but you shouldn't :)
See here: Adding HTML entities using CSS content
you won't be able to insert other things than text-element with css
BUT, what you want to do can be achieved this way :
.textblockquote:before{
color:green; /* <-- apply the styling you want */
content: "\0022"; /* <-- escaped unicode for 'quote' */
}
In the meantime, your question has already been answered (30 months ago): Using :before and :after CSS selector to insert Html
Look :
Its possible but its designed for text not html. http://www.quirksmode.org/css/content.html,
Here is an example how you can achive this in Firefox. ( 2nd answer ) Insert HTML from CSS
You can add content as text for example, and customize it for you needs. In your case, you can add quotes in content
of :before and :after elements, and absolute position them where you want.