Emojis have become an essential part of our digital communication, and with HTML, you can easily add them to your web pages. In this comprehensive tutorial, we'll explore how to use emojis in HTML. Let's get started! 🚀
Emojis are small digital images or icons used to express emotions, ideas, or reactions in text messages, social media posts, and websites. They are widely used to add some fun and personality to online communication.
HTML provides a simple way to include emojis in your web pages using the & symbol, followed by a unique code known as a "character entity."
Here's a list of some commonly used emojis and their corresponding HTML character entity codes:
☺✌💔⚥☓To add an emoji to your HTML, follow these simple steps:
& symbol and a semicolon (;).Here's an example of adding a smiling face emoji to your HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Emoji</title>
</head>
<body>
<h1>☺ I'm Smiling!</h1>
</body>
</html>Save the file as emoji.html and open it in your web browser to see the smiling face emoji in action! 🎉
Let's create a simple web page that displays a collection of emojis using the character entity codes from the list:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Emoji Gallery</title>
</head>
<body>
<h1>Emoji Gallery 🎭</h1>
<h2>Smiling Face 😃 - ☺</h2>
<h2>Waving Hand 👋 - ✌</h2>
<h2>Party Popper 🎉 - 💔</h2>
<h2>Sports Medal 🎯 - ⚥</h2>
<h2>Notebook 📝 - ☓</h2>
</body>
</html>Save the file as emoji_gallery.html and open it in your web browser to see the Emoji Gallery! 🎭
What symbol is used in HTML to include emojis?
By now, you should have a good understanding of how to use emojis in HTML. Emojis are a fun and engaging way to add some personality to your web pages, making them more appealing to users. Happy coding, and keep learning! 💻🎓