Symbols and Emojis
With UTF-8, you can type symbols and emoji directly, or use their numbers such as ☃ for a snowman. Emoji are characters, so they scale with the font size and take the text colour as a fallback.
Give meaningful emoji an accessible label with role="img" and aria-label, and hide purely decorative ones with aria-hidden="true".
Example
<p style="font-size: 32px">
<span role="img" aria-label="rocket">🚀</span>
<span aria-hidden="true">✨</span>
</p>Exercise
Label the emoji for screen readers.
<span role="img" ="star">⭐</span>
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.