Live data from Hacker News

HTML: font color=”red” becomes green

jsfiddle.net

11–20 of 99 posts

Re: HTML: font color=”red” becomes green

#11
There was a big Stack Overflow post on HTML color rendering[0].

Basically, the browser thinks it's looking at a malformed hex number and strips the invalid chars, in this case turning “red” into 00ED0. This is padded with 0s until it's divisible by 3, giving 00ED00.

[0]http://stackoverflow.com/questions/8318911/why-does-html-thi...

Re: HTML: font color=”red” becomes green

#12

I don't know why is considering that as a RGB notation instead of the color red, but following this progression seems correct: http://jsfiddle.net/7ACky/2/ red => #red => #0ed => #ed => #ed0 => #eedd00 Could be this? EDIT: That was wrong: red => #red => #0ed => #00ed00 seems the correct one.

Thats odd but I see it all light green on Chrome, Windows 7. http://i.imgur.com/0mRarjC.png

Re: HTML: font color=”red” becomes green

#15

http://www.whatwg.org/specs/web-apps/current-work/multipage/... = ”red” = 0red0 (" is not ascii so make 0) = 00ed0 (r is not hex so make 0) = 00ed00 (pad)

That makes a great lot of sense, well explained! This should be on top of the comments.

Edit: Heh

Post reply on HN