<!–

main_leaderboard, all: [728,90][970,90][320,50][468,60]

–>

HTML Emojis usage

In this article, we’ll discuss HTML emojis. UTF-8 is the character set used by emojis: 😄 😠💗

What are Emojis?

Despite their appearance, emojis are not images or icons. These characters come from the UTF-8 (Unicode) character set.

Most characters and symbols in the world can be encoded using UTF-8.



The HTML charset Attribute

Web browsers need to know the character set used in an HTML page to portray it accurately. Here is an example of HTML emojis:

There is a specification for this in the <meta> tag:

<meta charset=”UTF-8″>

Note: Unless otherwise specified, HTML uses UTF-8 as its default character set.


UTF-8 Characters

HTML emojis can show UTF-8 characters that can’t be documented with entity numbers

  • X is 88
  • Y is 89
  • Z is 90

Example

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body><p>Output will be X Y Z</p> <p>Output will be X Y Z</p></body> </html>

Example Explained

The <meta charset=”UTF-8″> element represents the character set.

The characters X, Y, and Z are indicated by the numbers 88, 89, and 90.

Whenever you display a character, you must start the entity number with &# and end it with ; (semicolon).


Emoji Characters

A UTF-8 character is also an emoji:

  • 😄 is 129410
  • 😠is 129411
  • 💗 is 129412

Example

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body><h1>Example Emoji</h1><p>🦑</p></body> </html>

HTML allows you to copy, display, and size Emojis just like any other character.

Example

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body><h1>Sized Emojis</h1><p style="font-size:48px"> 😉 😊 😋 😍 </p></body> </html>

Here is another example of the emoji character:

Example: 

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <h1>Emoji</h1> <p> 😄 </p> </body> </html>

CSS can also be applied to the emoji set here is an example:

Example: 

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style> p{ font-size: 25px; background-color: aqua; } </style> </head> <body> <h1>Emoji</h1> <p> 😄 😅😆😇 </p> </body> </html>

Some Emoji Symbols in UTF-8

EmojiValue
🗼🗼
🗻🗻
🗽🗽
😀😀
😄😄
😅😅
🗿🗿
🗾🗾
ðŸ˜😁
😃😃
😂😂
Tip: You can find a full list of HTML tags in our HTML Tag Reference.

Use of Emojis in HTML Document

Emojis are a type of symbol that can be used to add visual interest and emotional context to text in HTML documents. Emojis can be inserted into HTML documents using Unicode character codes, which represent a specific emoji image.

To insert an emoji into an HTML document, the Unicode character code for the desired emoji must be included within the code for the text. For example, the Unicode character code for a smiling face emoji is “U+1F600”, and it can be added to HTML code as follows: “😄”. This code will display the smiling face emoji in the HTML document.

Emojis can be used to add emphasis or convey emotion in text, such as in social media posts or messaging apps. They can also be used to improve the accessibility of content for individuals with disabilities, such as visual impairments, who may benefit from the additional visual cues provided by emojis.

However, it is important to use emojis appropriately and in moderation, as overuse or misuse of emojis can reduce the professionalism and clarity of the content. Additionally, not all web browsers or devices may support all emoji characters, so it is important to test for compatibility before using emojis in HTML documents.

If this article somewhere met your educational needs, do subscribe to our Newsletter below to get surrounded by the technical information on this site.
We value your feedback.
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Subscribe To Our Newsletter
Enter your email to receive a weekly round-up of our best posts. Learn more!
icon

Leave a Reply

Your email address will not be published. Required fields are marked *