Hacker News new | ask | show | jobs
by DiabloD3 5231 days ago
Wouldn't <html/> be the smallest?
3 comments

The shortest HTML4 (and earlier) document is

  <title//x
This uses the never-implemented but legal shorttag syntax for the required title element, and the "x" character serves as the body content.
I would have thought that

<!DOCTYPE html>0

would be the smallest.

Smallest what? There's no DOCTYPE.
It's worth adding that the DOCTYPE is what specifies what HTML rendering engine IE 7 and 8 use. A document without the DOCTYPE directive will render in quirks mode, and nobody wants that.