Live data from Hacker News

HTML: font color=”red” becomes green

jsfiddle.net

71–80 of 99 posts

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

#72
1) Curly quotes are not a valid surrounding for values.

2) will usually be interpreted as a value by browsers, even though it's illegal, because everything on the web is wrong

3) The browser sees curly quotes as part of baz

4) For lord only knows what reason, the most basic interpretation of that curly quote appears to be the color green. That'll be somewhere in the CSS spec. I don't care to look it up.

If you change those to straight quotes, suddenly it'll start working. Notice that JSFiddle also highlights the source differently.

http://jsfiddle.net/WGSNX/1876/

By the way, the "font" tag is over, and setting color that way is also over. Like this please if you need to do inline styling.

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

#73

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)

Sorry, this isn't correct. Red is a perfectly valid color value. This is not about property expansion.

This is because the source uses curly quotes, which are not recognized as a parameter bracketing, and so the curly quotes are trying to be interpreted as part of the value.

Change the quotes to actual quotes and it starts working as expected.

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

#74

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)

Sorry, this isn't correct. Red is a perfectly valid color value. This is not about property expansion. This is because the source uses curly quotes, which are not recognized as a parameter bracketing, and so the curly quotes are trying to be interpreted as part of the value. Change the quotes to actual quotes and it starts working as expected.

No, the OP is correct. You're right that is a valid CSS color keyword, but is not. Because of this, the CSS spec treats it as a "legacy color value" and attempts to interpret it as a string of characters (including the quotes) rather than a keyword.

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

#76

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)

Sorry, this isn't correct. Red is a perfectly valid color value. This is not about property expansion. This is because the source uses curly quotes, which are not recognized as a parameter bracketing, and so the curly quotes are trying to be interpreted as part of the value. Change the quotes to actual quotes and it starts working as expected.

The quotes in my explanation are the 'curly' quotes. They just display differently on HN.

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

#77
post #74

Earlier quoted context omitted.

Sorry, this isn't correct. Red is a perfectly valid color value. This is not about property expansion. This is because the source uses curly quotes, which are not recognized as a parameter bracketing, and so the curly quotes are trying to be interpreted as part of the value. Change the quotes to actual quotes and it starts working as expected.

No, the OP is correct. You're right that is a valid CSS color keyword, but is not. Because of this, the CSS spec treats it as a "legacy color value" and attempts to interpret it as a string of characters (including the quotes) rather than a keyword.

yeap
Post reply on HN