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

Transparent <font color> becomes red

This html shows a red text in Chrome and Firefox:

<font color="rgba(0,0,0,0)">foobar</font>

One would expect transparent font. Is this a browser-bug?

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

>Solution :

You are confusing HTML and CSS. The color attribute of the font element only takes an hex value, such as #000000 which doesn’t support transparency. (See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font#attr-color). rgba(0,0,0,0) is CSS syntax and can’t be used there.

Generally you shouldn’t be using the font element anyway.

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