4
On the website w3schools has the reference of all characters - specials, symbols, alphanumerics. I did not understand the purpose of having this representation of characters. In the example below the output is the same, only changes the entity.
- When should we use
CSS entity
and/or when using the character? - There’s a difference between writing one way or another?
\00A9 => ©
© => ©
\0041 => A
A => A
.copy1:before{content:'\00A9'; margin-right:3px}
.copy2:before{content:'©'; margin-right:3px}
.copy3:before{content:'\0041'; margin-right:3px}
.copy4:before{content:'A'; margin-right:3px}
<div class="copy1"></div>
<div class="copy2"></div>
<div class="copy3"></div>
<div class="copy4"></div>
I can’t say, but one possible advantage is that using entities would be to take advantage of CSS in different documents/HTML pages with different encodings, for example, using a CSS
\00C3
that would beÃ
, it would work well on both a UTF-8 page and a windows-1252 page... Now something likediv:after { content: 'Ã'; }
will surely have problems depending on the encoding that saved the document.css
– Guilherme Nascimento