Why does HTML think “chucknorris” is a color? (2011)
stackoverflow.com
stackoverflow.com
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!
(somebody had to say it)
“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_na...
Given the title of the "world's most popular novel", I'd count on this spelling becoming normative over time.
To elaborate: In the very early days, HTML was often written by hand. Part of the early vision of the web was that anybody could write HTML and publish content.
It was thought that allowing malformed HTML to result in a completely blank page or an error message would be too unfriendly for less technical users.
In those early pre-CSS pre-JavaScript days, HTML was more like bbcode, Markdown, or RST today. It's interesting that AFAIK those languages don't have a notion of malformed input -- there is no movement to tighten the bolts on Markdown in the way that XHTML attempted to tighten the bolts on HTML.
I just had a conversation with an iPhone repair guy. He asked me to help him fix a centering problem in his website. So he pulled up the HTML, and it was just awful. Table-based layout, broken tags... But it worked, and I taught him about the <center> tag. He gave me a discount on my repair.
Malformed HTML input is still very much alive and well, and necessary for non-technical people.
Of course, now we've replaced the hundreds of <td> with hundreds of JS files instead. Problem solved!
But it was OK because the forum was running phpBB, which would invariably be hacked/spammed, so you'd be getting a free dialer which was guaranteed increase download speeds ;)
Oh the horror.
It's still often written by hand, but not generally by novices.
Quite the opposite!
Regarding CSS, it rose very gradually, but its rise created a slowly growing problem for Dreamweaver, resulting in the transition from then, when most pros used it for at least part of their workflow, to now, when most don't. Dreamweaver had the best WYSIWYG mode of any HTML editor at the time, and it had a pure code editor, and its big claim to fame was that you could edit in either, jump back and forth between modes, and they would (mostly) remain in sync. You'd do the rough layout visually, then tweak the details in the resulting code, then tweak a bit more visually, then add another touch of code, etc. As non-HTML components on the front end gradually became more important, people used the WYSIWYG mode less and less, gradually shifting toward straight coding, significantly reducing the value of DW's dual-mode advantage over pure code editors.
Oh but there was one, and it was desperately needed!
Gruber's original implementation was absolutely riddled with logical inconsistencies, outright bugs, and even an escaping vulnerability that was exploited by an XSS worm to self-replicate on Reddit.
This project originally started as a PHP transliteration of Gruber's pile of regexes, and it's early version history is a nice summary of all the warts as they were discovered (and never fixed upstream): http://michelf.ca/projects/php-markdown/classic/#version-his...
If that's your belief system no problem.
If not perhaps rethink just how cool he and this whole meme is.
(good point, though - he's pretty much an anti-gay, gun-toting dick)
What's the process by which a stack overflow question hits HN?
How does the OP
1. Wander into this question
2. Decide it's worth sharing
3. Decide to post on HN specifically?
And sometimes I stumble over things I didn't yet know and find interesting. I posted one such case here once.
But that's just me.