Philip Walton
Philip Walton

Reputation: 30461

Is it safe to assume users can see unicode characters U+2716 and U+2714 in CSS content?

I'm wanting to use the characters ✖ (U+2716) and ✔ (U+2714) in my CSS for form validation purposes. Basically, if a field is valid/invalid, I use the after pseudo class to insert the corresponding symbol after the field.

For example:

.field:after {
  content: "\2716";
}

This is working great on my Mac, but when I switch to my Windows XP VMWare instance, I don't get the characters, no matter what font I choose (even Arial).

My suspicion is that perhaps my Windows VM isn't configured properly, but that causes me to be weary of using these characters at all.

Does anyone know if there are "safe" characters or ranges in unicode that you can reliably assume will be viewable by most people?

UDPATE:

Here is a list of unicode characters I was hoping to possibly be able to use as icons. Specifically the dingbats section. http://en.wikipedia.org/wiki/List_of_Unicode_characters#Dingbats

If you don't see these characters on your machine, definitely let me know in the comments.

Upvotes: 12

Views: 1983

Answers (2)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201748

In addition to the problems of using CSS for presenting essential information (see CSS Caveats), there’s the problem that the characters mentioned are often not available in people’s computers. The fonts supporting them do not contain any font that is shipped with a Windows system, for example. Support exists in Arial Unicode MS, which is shipped with Microsoft Office, but not everyone is using Office.

Besides, the symbols are not universal. A symbol like “✔” meant wrong when I was at school.

Using “OK” and “error” might be best, unless you need to use some other language.

Upvotes: 10

David Ly
David Ly

Reputation: 31596

What browser are you using in your XP VM? IE6 and 7 don't support the :after selector, so that might be the issue.

Upvotes: 0

Related Questions