Loading lessons...
HTML Emojis
Emojis are pictures made of characters! You can type them right into your HTML, or use character codes.
Just paste the emoji!
Modern HTML uses UTF-8, so you can type emojis directly:
html
<p>I love pizza! 😋 </p>
Wait, that used a code. Here's typing it directly:
html
<p>I love coding! ๐</p>
Using character codes
Some emojis are easier to write as a code. Each emoji has a number, and you write it as &#<number>;.
html
<p>😀</p> <! - ๐ grinning face - >
<p>😁</p> <! - ๐ grinning face with smiling eyes - >
<p>😂</p> <! - ๐ face with tears of joy - >
<p>😅</p> <! - ๐
smiling face with open mouth and cold sweat - >
<p>😊</p> <! - ๐ smiling face with smiling eyes - >
Popular emojis and their codes
html
💗 โค๏ธ red heart
💙 ๐ blue heart
💜 ๐ purple heart
😍 ๐ smiling face with heart-eyes
😎 ๐ smiling face with sunglasses
🙄 ๐ face with rolling eyes
🎉 ๐ party popper
🌸 ๐ธ cherry blossom
🍕 ๐ pizza
👍 ๐ thumbs up
Make sure your page uses UTF-8
For emojis to work, include the charset meta:
html
<meta charset="UTF-8">
TL;DR
- Emojis are characters; UTF-8 lets them work.
- Type emojis directly, or use
&#number;codes. 😀is a smiling face,💗is a heart.- Always set
<meta charset="UTF-8">. - Don't overuse them: a sprinkle is better than a flood!