Special Content CSS Content: Hex vs normal character

Example "BLACK STAR" ★ (U + 2605)

.a:after {
   content: "\2605";
   position:absolute;
}

.b:after {
   content: "★";
   position:absolute;
}

Demo: http://jsfiddle.net/l2aelba/vBjxX/

Why is someone / recommended to use HEX as \2605in CSS value? Both will get the same result.

+5
source share
2 answers

It is always better to use actual values ​​instead of special hard-coded characters, such as your lower example, as it is likely that they will not display correctly due to the encoding of the CSS file itself.

+3
source

You do not need to memorize funny keyboard shortcuts to add a Unicode number for one.

, . , , , css.

, , Awesome, , Unicode. .

. , , - .

? , , css-. , , . .

, , , . , , ? , .

+2

All Articles