Return to use unicode with css

I was wondering if it is possible to back up using Unicode characters. See how I got the following css:

.icon-check:after { content:'\2714'; color: green; } 

and he will not have the support of this character, is there a way to print β€œyes” or something else?

It's easy for fonts, like p{font-family:"Times New Roman", Times, serif;} . But for the content attribute, there seems to be no way to create such a reserve.

NB I know there are other features like Awesome, Glyphicons and the like, but I'm just wondering if there is a reserve.

+4
css unicode
source share
1 answer

Is there a way to print yes or something else?

Simple answer? No.

I was wondering if it is possible to back up using unicode characters

Simple answer? Yes ... ish .

The only reserve you can specify is the font family, however you can use @fontface to specify the unicode range of the font used.

The Unicode CSS descriptor sets a specific range of characters for loading from the font specified by the @ font-face font and for use on the current page.

an excellent 24-way article that describes how this can be done, you can, for example, specify a font family only for the character in question, for example (from the article):

 @font-face { font-family: 'Ampersand'; src: local('Baskerville'), local('Palatino'), local('Book Antiqua'); unicode-range: U+26; } 

Then do:

 .icon-check:after { content:'\26'; color: green; } 

Nb. the above applies to ampersand, but should give you an idea of ​​one approach.

+6
source share

All Articles