Hacker News new | past | comments | ask | show | jobs | submit login
[dupe] Why does HTML think “chucknorris” is a color? (2011) (stackoverflow.com)
188 points by Techasura on Nov 3, 2013 | hide | past | web | favorite | 43 comments



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!


Don'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.


So, you are saying this is a gray area?

(somebody had to say it)


Yep, Firefox supported both spellings while IE displayed green for 'grey'.


I've heard it described as, "gray is a color, grey is a colour"


To me "gray" just seems wrong, grey feels right.


Actually, 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_na...


I 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.


Not 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.


> HTML is built around intentionally ignoring malformed input

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.


Surely "ye olden HTML days" aren't that far back that we should be talking about them in past tense?

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.


<center> is deprecated in HTML5. Unfortunately teaching him about margin: 0 auto and text-align: center might be a bit more complicated.


Sounds like that was the least of his HTML problems. Probably wasn't using CSS at all of he was using tables for layout.


Let he who has not used table-based layout cast the first stone ...


Table based layouts (still being used on practically every forum I frequent) weren't so bad until mobile came into the picture. With fixed sizes, they just weren't flexible. Plus the added bandwidth of sending hundreds of <td>s were non-trivial for those of us who were on a shoestring budget and had sudden influx of visitors back in the day.

Of course, now we've replaced the hundreds of <td> with hundreds of JS files instead. Problem solved!


If I remember correctly, in IE6, the table didn't load until all of the elements loaded. That's how they tought us tables were baaad.


Indeed, you do remember correctly. This was especially fun on dialup.

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 ;)


I remember thinking, "Wow! It even makes these stylish borders around the cells"

Oh the horror.


>In the very early days, HTML was often written by hand

It's still often written by hand, but not generally by novices.


When I was younger I assumed pros used Dreamweaver.

Quite the opposite!


If it was more than about ten years ago, you were correct. In the late 90s and early 2000s, a majority (>50%) of professional Web developers used Dreamweaver, according to market surveys done at the time. It worked quite well when the formatting was in the HTML instead of CSS. It was essentially a GUI word processor with an HTML file format. When CSS took over the presentation role, drawing the interface like a MS-Word doc no longer really worked.


Do you have a link to one of those surveys? I just find that incredibly difficult to believe given that a) CSS had really started to take off by then (early 2000s) b) even using presentational HTML, it's much harder to work in a WYSIWYG environment when it comes to fine-grained control (which is what professionals are likely to require) than in a text editor.


Sorry, I don't have any such link, but I was in the dev tools business then, and I remember, for what it's worth.

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.


One thing I really really really find horrible in word processors is the nonseparation of content and presentation. Yes, they have paragraph styles you can apply, and hope everything you marked with that style actually changes when you change the style, but in practice it never seems to work well and the UX leaves much to be desired.


Pros assumed that you used Dreamweaver?


I always write it by hand, still haven't found a tool that does it better.


I think pretty much all professionals do, aside from tools like emmet, insertion of nodes at run time via JavaScript, and of course Markdown.


> there is no movement to tighten the bolts on Markdown

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...



I thought it was because Chuck Norris doesn't adhere to web standards - web standards adhere to him!


Thank you! This was the only reason I clicked into the comments, and you delivered well.


Please remember Chuck Norris is a fundamentalist christian who doesn't like gays and is against evolution in schools.

If that's your belief system no problem.

If not perhaps rethink just how cool he and this whole meme is.


I have always thought the meme was really saying the total opposite, by saying how cool he is was really making fun of him for the reasons you state.


presumably against the teaching of evolution in schools ...

(good point, though - he's pretty much an anti-gay, gun-toting dick)


Waning: Meta

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?


It was just posted on reddit for the 100th time (r/webdev)


The post is a year old, but received a lot of views/tags/upvotes so a stackoverflow "top threads" reader might be reading these in his or her downtime.


4. Manage to avoid the HN dupe checker.


As for me, I often explore related questions if their title is interesting. I also follow a few people who post very good answers because they're usually a joy to read.

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.



Noticed I added references to Netscape classic source code.


Of course Chuck Norris is a color. He just has more bits than other colors.


Who would argue otherwise?




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: