Use emoji as list bullet points using CSS list-style
Find out two different ways to use emoji as bullet point using list-style in CSS with the help of :before pseudo-element and @counter-style CSS at rule.
In this article, we will see how to style list bullet points with emoji in HTML.
In HTML the available list styles are very limited and sometimes it may make the list look boring.
So, how to make our old HTML bullet points a little bit more interesting? The answer is adding Emojis.
So, here in this post, we will see how to replace the bullet points with Emojis using CSS.
We can add emoji using to list-style using:
- Using
:beforepseudo-element - using
@counter-styleCSS rule
Using :before pseudo-element
We have to use the :before element to replace the disc bullet point style with an emoji.
First we have to set the parent, <ul> or <ol> list-style property to none, list-style:none and then setting the margin and padding to 0px.
Next, to add the emoji icons before the list items we will use the content property on :before pseudo-element on the <li> tag.
Example:
ul{ margin:0px; padding:0px } ul li{ list-style:none; } ul li:before{ content: '👉' }
Result:

You can also select different emojis for different list items using the nth-child selector like this
ul li:before{ content: '👉' } li:nth-child(2)::before { content: '🔎 '; } li:nth-child(3)::before { content: '🗯 '; }
Result:

Using @counter-style to create emoji list bullet point
The @counter-style CSS at-rule allows you to create/define a custom counter-style that is not a part of a pre-defined set of styles.
It takes in three properties: 1. system, 2. symbols, and 3. suffix
system: It lets you specify the algorithm to convert the integer value into a string representation. It accepts the following values:
cyclic | numeric | alphabetic | symbolic | additive | [fixed <integer>?] | [ extends <counter-style-name> ]
symbols: These are the Unicode code points to represent the emojis. You can add multiple space-separated sets of symbols. Get the List of Unicode codes of Emoji.
suffix: Any character you want to appear after the counter and before the text. We will keep it blank space (" ") here.
Example:
@counter-style emoji-bullets { system: cyclic; symbols: "\1F680""\1F436""\1F60E"; suffix: " "; } /* Add this class to the ul or ol element */ ul li { list-style-type: emoji-bullets; }
Result:

Read more about @counter-style here: @counter-style | MDN - Mozilla
Related Topics:
How to remove bullets from an unordered list using CSS
Related Posts
How to create a horizontal list using HTML and CSS
Find out different ways to create horizontal list using inline-block and flex-box in CSS for your navigation bar on your website.
How to use calc() in tailwind CSS
Learn the use of calc() in tailwind CSS class. The calc() CSS function allows complex calculations to determine element sizes responsively.
Vertically Center Align a div in Tailwind CSS
Learn how to vertically center align a div in Tailwind CSS using Flexbox and absolute positioning and make your web development more efficient and fast.
Create a vertical line using Html and Css
Learn with step-by-step instruction on how to add vertical line in HTML using CSS border, transform and pseudo classes.
