HTML Emoji
Emoji are characters from the UTF-8 character set: grinning face, heart-eyes face, and revolving hearts.
Emojis (English: emoji; from Japanese words meaning 'picture' and 'character') are ideographic symbols used in web pages and chats. They were originally visual emotional symbols (pictographs) used in Japanese wireless communication. 'Expression' refers to facial expressions, while 'icon' means a graphic symbol; they can represent many expressions, such as a smiley face for laughter or a cake for food. An emoji looks like a picture or an icon, but actually it is not.
Emoji are actually characters in the UTF-8 (Unicode) character set.
UTF-8 covers almost all characters and symbols in the world.
HTML charset Attribute
To display an HTML page correctly, the browser needs to know the character set used by the page. The character set in a web page is specified with the
tag:
Note:If we do not explicitly specify the meta attribute, the default character encoding is also UTF-8.
For more on UTF-8 encoding, see: [HTML Unicode (UTF-8) Reference Manual](/charsets/ref-html-utf8.html)
UTF-8 Characters
Many UTF-8 characters cannot be typed on a keyboard, but we can represent them using numbers (called entity numbers):
- A is 65
- B is 66
- C is 67
Example
<!DOCTYPE html><html>
<head>
<meta charset="UTF-8" head>
<body>
<p>Result: A B C
p
<
p
Result: A B C
p
body
html
Try it »
** Example Explained:**
Defines the character set.A, B, and C can also be represented using 65, 66, and 67.
An entity number must start with and end with a semicolon ; so that the character is displayed correctly.
Emoji are also characters, so they can be used in HTML pages just like any other character:
Example
<!DOCTYPE html><html>
<head>
<meta charset="UTF-8" head>
<body>
<h1>Emoji Tag Symbols
h1
<
p
You can set the size of an emoji with the font-size property, just as you set the font size.
p
<p style="font-size:48px">😀 😄 😍 💗
p
body
html
Try it »
Emoji Emoticons
The table below lists some emoji symbols:
| Emoji | Value |
|---|---|
| 🗻 | 🗻 |
| 🗼 | 🗼 |
| 🗽 | 🗽 |
| 🗾 | 🗾 |
| 🗿 | 🗿 |
| 😀 | 😀 |
| 😁 | 😁 |
| 😂 | 😂 |
| 😃 | 😃 |
| 😄 | 😄 |
| 😅 | 😅 |
For more on Emoji, see: Emoji Reference Manual