Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding HTML entities using CSS content

How do you use the CSS content property to add HTML entities?

Using something like this just prints   to the screen instead of the non-breaking space:

.breadcrumbs a:before {   content: ' '; } 
like image 397
nickf Avatar asked Oct 10 '08 07:10

nickf


People also ask

Can you add HTML in CSS content?

Unfortunately, this is not possible. Per the spec: Generated content does not alter the document tree. In particular, it is not fed back to the document language processor (e.g., for reparsing).

Can you style HTML entities?

No. HTML entities represent characters. Characters (except for emoji) do not have inherent colour. Show activity on this post.


1 Answers

You have to use the escaped unicode :

Like

.breadcrumbs a:before {   content: '\0000a0'; } 

More info on : http://www.evotech.net/blog/2007/04/named-html-entities-in-numeric-order/

like image 150
mathieu Avatar answered Oct 12 '22 19:10

mathieu