The Skinny on Doctypes
Update: For the record, this is the standard forward compatible HTML 5 doctype. This should always work.
Doctypes have long been in standardista discussions circles. Why to use them. Which one to use. Which one is best. These are all <sarcasm>really fun details</sarcasm> to get into, but the most important aspect of any doctype is simply having one, since without one, you're stuck in the lovely world of "quirks mode". If you're interested in understanding the anatomy of a doctype, then by all means, dive in.
At Google, we have this obsession with byte size. And by byte size, any "lack-therof" the better. Therefore the doctype you will find on most Google webpages while still triggering the browser into "standards mode" is as simple as you see below:
The skinny doctype
<!doctype html>
There is really, absolutely no reason you need the rest of the doctype in your declaration unless you're validating code. Furthermore, it does not mean that your page is even invalid. In the end, it puts your webpages into standards mode, which is what really matters. (Plus it's easy to memorize ;)
Try it out. It will fix your box model in IE6 and clobber all those other funny gotchas when you're in quirks mode. Cheers.
Update: David was kind enough to share his results using the skinny doctype on his blog. The results, as expected, keep your browser tame.
recent
- Matador: The Obvious MVC Framework for Node
- Sandboxing JavaScript
- Crouching Ender, hidden command
- Ender.js - The open submodule library
- Qwery - The Tiny Selector Engine
- Klass
- Smallest DOMReady code, ever.
- $script.js - Another JavaScript loader
- About that slowness on Twitter...
- Autocomplete Fuzzy Matching
- JavaScript Cache Provider
- JavaScript Animate
- Asynchronous method queue chaining in JavaScript
- Something changed
- Unofficial Twitter Widget Documentation
i am dustin diaz

