Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to control colour of this Unicode character in Edge, without changing font? (Current code works fine with Firefox.)

The following code is intended to print a red version of the Unicode character with HTML code &#9724. It does this in Firefox, but it prints black in Edge. How can I amend the code so that it will print red, as desired, in both browsers?

<html>
<body>
<span style="color:#f00";>&#9724;</span>
</body>
</html>

I opened the page in both Firefox and Edge.

Changing the span to

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<span style="color:#f00;
     font-family:Segoe UI Symbol">&#9724;</span>

works, but is there a way to do it that doesn’t involve changing the font?

>Solution :

Your syntax is invalid, you must place the semi-colon within the double quotes. Additionally, the semi-colon is optional for the last style.

<span style="color: #f00;">&#9724;</span>
<!--                    ^ Either remove the semi-colon or place it inside the quotes -->
<span style="color: #f00; font-family: Segoe UI Symbol;">&#9724;</span>

Edit: This works out of the box, without the need to change the font.

<span style="color: #f00;">&#9724;</span>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading