How to dye a multi-colored Unicode icon-character? Is there a CSS and/or JavaScript hack?

Please consider this Unicode icon-character:


As can be seen, it’s multicolored hardcodedly.

I can make it to be be Gray by hue, but not by color, this way:

<!DOCTYPE html>
        <span style="filter: grayscale(100%);">📱</span>

I want to make it just single-colored (Blue) but the following code doesn’t work due to the character-icon being multicolored hardcodedly.

<!DOCTYPE html>
        <span style="color: blue;">📱</span>

Is there any CSS and/or JavaScript hack to use here to cause that Unicode icon-character to appear just Blue?

You should probably keep in mind that these Unicode characters do not render the same on all systems. Take a look at the symbol display page for this character.

If you want a consistent rendering, you should use an image and not a Unicode character.

In this specific usecase the variants don’t matter much to me, rather, only the color does.

Change the color of a multi-colored Unicode icon-character, you can use CSS and, if needed, JavaScript to apply color styles. However, keep in mind that not all Unicode characters are easily stylable or support multi-color rendering in all browsers.

Here example of HTML

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="styles.css">
  <title>Colored Unicode Icon</title>
  <div class="colored-icon">&#x1F499;</div>

CSS code (styles.css):

body {
  font-family: 'Arial', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  margin: 0;

.colored-icon {
  font-size: 4em;
.red {
  color: red;
.blue {
  color: blue;

The HTML includes a

element with a Unicode heart character (:blue_heart:).

The CSS sets up some basic styling and defines classes for different colors.
You can apply different color classes to the .colored-icon div to change its color.
If you need dynamic color changes or additional interactivity, you can use JavaScript. For instance, you might toggle between colors on a button click.

For Example Javascript code here:

document.addEventListener('DOMContentLoaded', function () {
  const coloredIcon = document.querySelector('.colored-icon');
  const colorButton = document.getElementById('colorButton');

  colorButton.addEventListener('click', function () {

This JavaScript example toggles between the ‘red’ and ‘blue’ classes on a button click.

Remember to check browser compatibility for Unicode characters and multi-color rendering. Not all characters support coloring in all browsers, and the appearance may vary across platforms. If you need more control over coloring, consider using SVG graphics instead of Unicode characters.

Just having a play, you can combine multiple filters e.g.

.blue-filter {

I don’t know if this is a recommended approach, but it appears to work.


When posting, in your text editor window, select your block of code and click on the </> in the text editor menu and this will format your code for you.

Basically it wraps the code/text in opening and closing backticks ``` my code here ```

I have done it for you this time.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.