Introduction
HTML emojis are Unicode characters that can be displayed directly on a webpage using numeric character references or by inserting the emoji itself. They make web pages more attractive and are commonly used in websites, blogs, forms, notifications, and messages. In this chapter, you’ll practice displaying emojis with simple solved examples.
Question 1
Problem Statement
Display a smiling face emoji on a webpage.
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>Smile Emoji</title>
</head>
<body>
<h1>Welcome</h1>
<p>😀</p>
</body>
</html>
Output
Welcome
π
Step-by-Step Explanation
😀displays the π emoji.- The emoji is represented using its Unicode number.
- Modern browsers automatically display the emoji.
Question 2
Problem Statement
Display multiple emojis in one paragraph.
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>Multiple Emojis</title>
</head>
<body>
<h1>Today's Mood</h1>
<p>
😀
😍
🚀
🎉
</p>
</body>
</html>
Output
Today's Mood
π π π π
Step-by-Step Explanation
- Each emoji has its own Unicode number.
- Multiple emojis can be displayed in the same paragraph.
- Browsers render each Unicode value as an emoji.
Question 3
Problem Statement
Display emojis inside a heading.
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>Emoji Heading</title>
</head>
<body>
<h1>
HTML Course
🚀
</h1>
</body>
</html>
Output
HTML Course π
Step-by-Step Explanation
- Emojis can be placed inside headings.
- They work with all heading tags (
<h1>to<h6>). - Emojis make headings more attractive.
Question 4
Problem Statement
Display emojis inside a list.
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>Emoji List</title>
</head>
<body>
<h1>Daily Tasks</h1>
<ul>
<li>✅ Learn HTML</li>
<li>📚 Read Notes</li>
<li>🎯 Practice Coding</li>
</ul>
</body>
</html>
Output
Daily Tasks
β Learn HTML
π Read Notes
π― Practice Coding
Step-by-Step Explanation
- Emojis can be used inside list items.
- They improve readability.
- They also make task lists more visually appealing.
Question 5
Problem Statement
Display emojis inside buttons.
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>Emoji Button</title>
</head>
<body>
<button>
👍 Like
</button>
<button>
🔁 Share
</button>
</body>
</html>
Output
π Like
π Share
Step-by-Step Explanation
- Emojis can be added to buttons.
- They help users quickly understand the button’s purpose.
- Buttons remain fully functional with emojis.
Question 6
Problem Statement
Display emojis inside a table.
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>Emoji Table</title>
</head>
<body>
<h1>Student Result</h1>
<table border="1">
<tr>
<th>Name</th>
<th>Status</th>
</tr>
<tr>
<td>Amit</td>
<td>β
Pass</td>
</tr>
<tr>
<td>Riya</td>
<td>β Topper</td>
</tr>
</table>
</body>
</html>
Output
Student Result
-------------------------
Name Status
-------------------------
Amit β
Pass
Riya β Topper
Step-by-Step Explanation
- Emojis can be displayed inside table cells.
- They highlight important information.
- Tables become easier to read.
Question 7
Problem Statement
Display emojis inside a contact form.
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>Emoji Form</title>
</head>
<body>
<h1>Contact Us π©</h1>
<form>
<label>π€ Name</label><br>
<input type="text"><br><br>
<label>π§ Email</label><br>
<input type="email"><br><br>
<label>π¬ Message</label><br>
<textarea></textarea><br><br>
<button>π Send</button>
</form>
</body>
</html>
Output
Contact Us π©
π€ Name
[__________]
π§ Email
[__________]
π¬ Message
[__________]
π Send
Step-by-Step Explanation
- Emojis can be added to labels and buttons.
- They improve the appearance of forms.
- The form works normally with emojis.
Question 8
Problem Statement
Display emojis inside a navigation menu.
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>Emoji Navigation</title>
</head>
<body>
<nav>
π <a href="#">Home</a> |
π <a href="#">Courses</a> |
π <a href="#">Contact</a>
</nav>
</body>
</html>
Output
π Home | π Courses | π Contact
Step-by-Step Explanation
- Emojis can be used before navigation links.
- They help users identify menu items quickly.
- Navigation remains simple and easy to use.
Question 9
Problem Statement
Display emojis inside an information card.
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>Emoji Card</title>
</head>
<body>
<div>
<h2>π HTML Course</h2>
<p>π 30 Chapters</p>
<p>β° Duration: 20 Hours</p>
<p>π Beginner Friendly</p>
</div>
</body>
</html>
Output
π HTML Course
π 30 Chapters
β° Duration: 20 Hours
π Beginner Friendly
Step-by-Step Explanation
- Emojis make cards more attractive.
- They improve visual organization.
- Readers can quickly understand each section.
Question 10
Problem Statement
Create a complete webpage that uses emojis in different HTML elements.
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>HTML Emoji Example</title>
</head>
<body>
<h1>π Learn HTML</h1>
<p>π Practice daily to improve your HTML skills.</p>
<ul>
<li>β
HTML Basics</li>
<li>π· Images</li>
<li>π¬ Videos</li>
<li>π Practice Questions</li>
</ul>
<button>π― Start Learning</button>
</body>
</html>
Output
π Learn HTML
π Practice daily to improve your HTML skills.
β’ β
HTML Basics
β’ π· Images
β’ π¬ Videos
β’ π Practice Questions
[ π― Start Learning ]
Step-by-Step Explanation
- Emojis can be used in headings.
- Emojis work inside paragraphs.
- Lists become easier to scan with emojis.
- Buttons look more engaging with emojis.
- Emojis improve the user experience without changing the HTML structure.
Key Takeaways
- HTML emojis are Unicode characters.
- Emojis can be written directly or using numeric character references.
- Emojis work in headings, paragraphs, lists, tables, forms, buttons, and navigation menus.
- Modern browsers support Unicode emojis.
- Emojis improve readability and visual appeal.
- Avoid using too many emojis on professional websites.
- Emojis do not affect HTML functionality.
- They are useful for blogs, portfolios, e-commerce sites, and educational websites.
- Unicode emojis work across different operating systems, though their appearance may vary slightly.
- Always use emojis where they add value to the content.
Frequently Asked Questions (FAQs)
1. What are HTML emojis?
HTML emojis are Unicode characters displayed on a webpage.
2. How can I display an emoji in HTML?
You can use the emoji directly or use its numeric character reference, such as:
😀
3. Do HTML emojis work in all browsers?
Yes. Modern browsers support Unicode emojis.
4. Can I use emojis inside headings?
Yes. Emojis work inside all heading tags.
5. Can emojis be used inside buttons?
Yes. Emojis can be added to buttons, links, forms, and other HTML elements.
6. Do emojis require JavaScript?
No. HTML emojis work without JavaScript.
7. Can I use emojis in forms?
Yes. Emojis can be added to labels, placeholders, and buttons.
8. Why do emojis look different on different devices?
Each operating system uses its own emoji design, so the appearance may vary slightly.
9. Can I copy and paste emojis directly into HTML?
Yes. You can type or paste emojis directly into your HTML file.
10. Should I use many emojis on every webpage?
No. Use emojis only where they improve readability and user experience.
Written by Shubhranshu Shekhar, who has trained 20000+ students in coding.
