Member-only story

Use Emoji in HTML, PHP, JavaScript and CSS

Badih Barakat
3 min readJan 31, 2022

--

Use Emoji in HTML, PHP, JavaScript and CSS
Photo by chaitanya pillala on Unsplash

Emojis are so popular in all platforms, whether in mobile apps or webpages. In comments, social media posts, text in web pages and so one. They provide emotional interaction with users and give a bit of life and feelings to the media.

In this article, I’ll show you how to include them in you HTML, PHP, JavaScript and CSS.

I’ll be referencing Emoji Unicode Tables as emojis reference.

HTML Emojis

You can add emojis in HTML using any of the 3 ways below:

  1. Direct emoji embedding in HTML code
  2. Using emoji decimal reference code
  3. Using emoji hexadecimal reference code

Let’s look at an example including all three methods.

What you should see is:

HTML emojis

Make sure to set the document’s character encoding to UTF-8 in the head…

--

--

Badih Barakat
Badih Barakat

Written by Badih Barakat

A Software Developer with 15 years of experience on various platforms.

No responses yet