Over two years ago, I published a dumb-funny little blog post called Please Don’t Learn To Code From Stock Photos. It got unearthed somehow and got shared around again recently.
Of course, it’s just for laughs, and by and large nobody took it too seriously. But also, there was one little thing in there that tickled the Well Actually Bone of quite a few developer folks. I’d say in the last year or so, 100 people or so have reached out to me one way or another to let me know.
The line of code in the stock photo was:
And I said:
Better make damn sure the background color of the body is white because otherwise who knows what it might end up.
The correction I get is either:
- Some version of IE had a light gray background, so if you wanted white you had to set white.
- People can have user stylesheets that un-white the background.
To which I would say:
- Interesting, I didn’t know that. Before my time. (Nor did I know that
bgcolor was a thing at all! It’s one of those long-deprecated but still-working things.)
- They did that on purpose. They may enjoy whatever background override they like.
I find it more interesting how insidious little ideas like this can be. At some point, this became a Very Important Best Practice and any written breach of it shall be issued an Official Warning, in perpetuity. Which is in contrast to the fact that I don’t think I’ve ever set an explicit white background on a site and don’t remember it ever coming up.
bgcolor=white is a post from CSS-Tricks