Live data from Hacker News

HTML: font color=”red” becomes green

jsfiddle.net

21–30 of 99 posts

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

#21
hmm... if i set colour to #000000 and use the correct quotes it changes the background and not the foreground.

isn't this just a case of using something incorrectly and getting an undefined result? just leaves me wondering why errors like this aren't reported or at least warned about by the browser.

if this was the compiler for any language that wasn't HTML (cringes at the thought of that being a language and not just a data format) it would never ship in such a poor state...

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

#22

Wow. I haven't seen a tag in years. My thought processes loading this: • Ok, that is in fact green. • I wonder if this is related to the colour name parsing weirdness that was on HN a couple of weeks ago? • Heeeey, those aren't ASCII quotes!

Maybe something is wrong with me, but the first thing I noticed was the quotes. In fact, from the title posted on HN.

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

#25

Wow. I haven't seen a tag in years. My thought processes loading this: • Ok, that is in fact green. • I wonder if this is related to the colour name parsing weirdness that was on HN a couple of weeks ago? • Heeeey, those aren't ASCII quotes!

_with_ ascii quotes, it works (it's red)

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

#27

Wow. I haven't seen a tag in years. My thought processes loading this: • Ok, that is in fact green. • I wonder if this is related to the colour name parsing weirdness that was on HN a couple of weeks ago? • Heeeey, those aren't ASCII quotes!

Green - with ascii quotes and an invisible seperator. http://jsfiddle.net/WGSNX/264/

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

#28
post #4
post #2

Cute. Use normal quotes ;) HTML colour parsing for invalidly specified colours is odd to say the least.

Hard to spot. I can imagine this happening in the real world. Several blogs engines seem to like automatically converting normal quotes to curly quotes in an attempt to prettify their text rendering. I remember copy and pasting code snippets in the and having to fix this.

And Word.

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

#30
post #23

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)

This neatly explains why `red` also becomes green.

#FF0000 also became green (with these quotes)
Post reply on HN