Using Emojis in HTML

Using Emojis in HTML

Emojis are small graphical symbols that represent emotions, objects, or concepts.
In HTML, you can use emojis in multiple ways:

  1. Directly typing the emoji

  2. Using HTML entities

  3. Using Unicode codes


1. Direct Emoji

You can directly paste the emoji into your HTML:


 

Output:
I love coding! 😄
Let’s have some coffee ☕


2. Using HTML Entity

Some emojis have named HTML entities:


 

Output:
Smiley face: 😀
Heart: ❤


3. Using Unicode

You can also use Unicode in HTML with &#x format:


 

Output:
Rocket: 🚀
Star: ⭐


Tips for Using Emojis

  • Emojis can be placed anywhere in text, inside <p>, <h1>, <button>, etc.

  • Ensure your HTML file uses UTF-8 encoding:

<meta charset="UTF-8">
  • Emojis may appear differently on different devices or browsers.


Emojis make your website fun, engaging, and expressive while adding visual context to content.

CodeCapsule

Sanjit Sinha — Web Developer | PHP • Laravel • CodeIgniter • MySQL • Bootstrap Founder, CodeCapsule — Student projects & practical coding guides. Email: info@codecapsule.in • Website: CodeCapsule.in

You may also like...

Leave a Reply

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