5 ms·
This definitely corrects a misconception I've had for years. When I first started writing HTML, I would set colours using the english colour names, for example
by tobyjsullivan 13y ago
This definitely corrects a misconception I've had for years.
When I first started writing HTML, I would set colours using the english colour names, for example color="red" or color="white" and this worked well for my needs.
However, I would always get an odd result when I tried to set the colour grey. Turns out, I didn't spell very well (I was pretty young at the time, though still spell atrociously).
<font color="gray">
And the colour would come out green. What?
I quickly realised my spelling error but wondered why things ended up green. I decided what was happening was that the interpreter read the colour name up until the first invalid character (in this case resulting in "gr"), then chose the closest match. Green would be before grey in alphabetical order and... voila!
I see now the solution was simply that gray was interpreted as 00 a0 00. Another life mystery solved!
- oneeyedpigeon 13y agoDon't beat yourself up about it: 'gray' is a perfectly legitimate US-English variant of the British-English 'grey'. In fact, 'Gray' is actually correct according to the spec (I had to look it up, and remember making this very mistake in the old days, which makes sense given that I'm British) I have a vague recollection that the 'misspelling' was actually handled differently between browsers.
- Amadou 13y agoSo, you are saying this is a gray area? (somebody had to say it)
- dhughes 13y agoTo me "gray" just seems wrong, grey feels right.
- toupeira 13y agoYep, Firefox supported both spellings while IE displayed green for 'grey'.
- minikites 13y agoI've heard it described as, "gray is a color, grey is a colour"
- Samuel_Michon 13y agoActually, in HTML, ‘grey’ is wrong, ‘gray’ is correct. “There are several tones of grey available for use with HTML and Cascading Style Sheets (CSS) as named colors, while 254 true greys are available by specification of a hex triplet for the RGB value. All are spelled gray, using the spelling grey can cause errors. This spelling was inherited from the X11 color list. Internet Explorer's Trident browser engine does not recognize grey and renders it green.” http://en.wikipedia.org/wiki/Grey#Grey_in_the_sciences.2C_nature.2C_and_technology http://en.wikipedia.org/wiki/Grey#Grey_in_the_sciences.2C_na...
- lemonberry 13y agoI grew up playing Dungeons and Dragons in the early 80's. The world you played in was Greyhawk. As a result, even though I'm from the US, that shade between black and white will always be grey.
- samatman 13y agoNot only that, my mother starts every morning with a cup of Earl Grey. I never had a chance! Given the title of the "world's most popular novel", I'd count on this spelling becoming normative over time.