3 ms·
1) Curly quotes are not a valid surrounding for values. 2) <foo bar=baz> will usually be interpreted as a value by browsers, even though it's illegal, because
by JohnHaugeland 13y ago
1) Curly quotes are not a valid surrounding for values.
2) <foo bar=baz> 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/ http://jsfiddle.net/WGSNX/1876/
By the way, the "font" tag is over, and setting color that way is also over. <span style="color:red">Like this please</span> if you need to do inline styling.
- russellsprouts 13y agoI believe that HTML 5 allows for unquoted values. As long as the attribute doors not contain HTML special characters or spaces, it's legal to omit them.
- reissbaker 13y agoCorrect. The HTML5 spec includes "unquoted attribute values," which have some special restrictions (no spaces, can't be the empty string, can't use HTML characters like >, <, or =, and — duh — no quotes). http://www.w3.org/TR/html-markup/syntax.html#attr-value-unquoted http://www.w3.org/TR/html-markup/syntax.html#attr-value-unqu...
- JohnHaugeland 13y agoYes, and that's the mechanism by which HTML gets confused and thinks that the curly quotes, which are not recognized as value bracketting, are part of the value.