Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to produce X mark in html.

Tags:

html

With the following code:

<span style="color:#008A00;font-size:11pt"> &#x2713; Tick </span>

I could able to get tick mark. See here. I tried this for ✗ mark:

<span style="color:#008A00;font-size:11pt"> &#x274c;  Wrong </span>

but it doesn't work. I got the hex code of ✗ from here.

Where I'm making mistake?

like image 485
batman Avatar asked Sep 05 '25 16:09

batman


1 Answers

As the fileformat.info page cited says, the character denoted by &#x274c;, i.e. CROSS MARK (U+274C) “❌”, was added to Unicode in version 6 in 2010. This means that most fonts don’t contain it. The font support page lists only a few fonts. Most computers in the world do not have any of these fonts installed; moreover, even if a suitable font exists, browsers may fail to use it unless you explicitly list it in a font-family declaration. So you would need to use @font-face to have it rendered in a cross-browser way.

If you actually meant to use U+2717 BALLOT X “✗”, then you can use &#x2717; (or enter the character as such). But CROSS MARK is what refer to as the character you tried to use; note that a comment in the Unicode standard says about it: “forms a game tally pair with 2B55”. So if you want to use CROSS MARK “❌”, it would be consistent to pair it with U+2B55 HEAVY LARGE CIRCLE “⭕”.

like image 90
Jukka K. Korpela Avatar answered Sep 07 '25 17:09

Jukka K. Korpela