Using Emojis in HTML

11-17-24

Emojis are characters from the UTF-8 character set: ㈐ 😍 💗

EmojiValue
🗻& #128507;
🗼& #128508;
🗽& #128509;
🗾& #128510;
🗿& #128511;
😀& #128512;
😁& #128513;
😂& #128514;
😃& #128515;
😄& #128516;
😅& #128517;

What are Emojis?

Emojis look like images, or icons, but they are not. They are letters (characters) from the UTF-8 (Unicode) character set.

UTF-8 covers almost all of the characters and symbols in the world.

The HTML charset Attribute

To display an HTML page currectly, a web browser must know the character set used in the page. This is specified in the <meta> tag:

<meta charset="UTF-8">

If not specified, UTF-8 is default character set in HTML.

UTF-8 Characters

Many UTF-8 characters cannot be typed on a keyboard, but they always can be displayed using numbers (called enity number):

<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<body>

<p>I will display A B C</p>
<I will display A B C

</body>
</html>

Example Explained

The <meta charset="UTF"> element defines the character set. The characters A, B, and C, are displayed by the numbers 65, 66, and 67. To let the browser understand that you are displaying a character, you must start the enity number with &# and end it with ; (semicolon).

Emoji Characters

Emojis are also characters from the UTF-8 alphabet:

<!DOCTYPE html>