Emojis
π Understanding Emojis π
Emojis are not just icons or images; they are actually characters from the UTF-8 (Unicode) character set. They help convey emotions, symbols, and expressions in digital communication.
π Categories of Emojis
- π Facial Expressions: Represent emotions (e.g., π, π’, π€©).
- π Objects & Symbols: Depict various items and concepts (e.g., π , π, β€οΈ).
- π© Flags: Display national and regional flags (e.g., πΊπΈ, π―π΅, π¬π§).
- π Miscellaneous: Include stars, flames, and musical notes (e.g., β, π₯, πΆ).
Emojis, such as π, π, and π, are part of the standard UTF-8 character encoding.
π Unicode Reference Table for Emojis
Emoji | Unicode Code |
---|---|
π» | 🗻 |
πΌ | 🗼 |
π½ | 🗽 |
πΎ | 🗾 |
πΏ | 🗿 |
π | 😀 |
π | 😁 |
π | 😂 |
π | 😃 |
π | 😄 |
π | 😅 |
π€ HTML Charset and Encoding
The charset
attribute in HTML defines the character encoding, ensuring that special characters, including emojis, render correctly on web pages. This is set using the meta
tag.
<meta charset="UTF-8">
π§ How It Works
- The
<meta charset="UTF-8">
declaration tells the browser to use UTF-8 encoding. - Standard characters like A, B, and C are represented numerically (e.g., 65, 66, 67).
- Special characters and symbols are inserted using their Unicode entity codes, starting with
&#
and ending with a semicolon (;
).
π£ Using UTF-8 Characters in HTML
Some UTF-8 characters are not directly available on a keyboard but can be included using entity numbers.
For example:
- The letter A has the code
65
- The letter B has the code
66
- The letter C has the code
67
Example Usage:
Displaying A B C
Displaying A B C
<p>Displaying A B C</p>
<p>Displaying A B C</p>
π Adding Emojis in HTML
Since emojis are part of UTF-8, they can be displayed using their respective Unicode values.
Examples:
- π β
😄
- π β
😍
- π β
💗
Example:
π My First Emoji
π
<h1>π My First Emoji</h1>
<p>😀</p>
π Adjusting Emoji Size in HTML
Since emojis function as text characters, they can be resized using CSS styles just like regular text.
π π π π
<h1>π¨ Large Emojis</h1>
<p style="font-size:48px">
😀 😄 😍 💗
</p>
Conclusion
Emojis are characters from the UTF-8 (Unicode)
character set, used to express emotions, objects, symbols, and more in digital communication. They belong to categories such as facial expressions, objects, flags, and miscellaneous symbols. Emojis can be added to HTML using their respective Unicode codes, which are written as &#
followed by the code and a semicolon.
Events
HTML events are actions that trigger JavaScript code, such as clicks, key presses, or page loads, allowing for dynamic behavior and interactivity on web pages.
Classes and Ids
In HTML, the class and id attributes are utilized for styling and identifying elements. Classes can be reused, whereas IDs must be unique within a page.