Greg
Greg

Reputation: 1803

Unicode Character 'BLACK DOWN-POINTING TRIANGLE' in Linux - CSS?

I'm trying to use a css file which contains the black down pointing triangle. In windows it works fine, but as soon as I copy the file to a Linux server the symbol becomes garbage.

How would I use this symbol in a css file on Linux.

 content: '.';

where the dot should be the symbol.

I've tried:

content: ▼
content: '&#9660';

which is supposed to be the value for the symbol but I'm guessing wrong as it doesnt work.

Upvotes: 0

Views: 6076

Answers (1)

Konrad Rudolph
Konrad Rudolph

Reputation: 545608

Your second attempt is trying to use HTML entities in CSS – obviously that doesn’t work. You can use an escaped character instead:

content: '\25BC';

(It must be in hexadecimal.)

However, you can (and should) simply use the character “▼” directly – you just need to save and open your file using the same, agreed on encoding. You fail to do so, and as a consequence the symbol is garbled. The best encoding to use is UTF-8, which is the agreed-on default encoding on the web, on Linux and for many other applications. However, some Windows editors still need to be told to please use this encoding manually.

Upvotes: 10

Related Questions