Hacker News new | ask | show | jobs
by Wilya 5231 days ago
The fact that it works is completely irrelevant. It has always worked, in about all versions of HTML/XHTML, in that type of simple cases.

The important fact is that omitting the html, body, head tags is valid markup. Whether browsers conform to this is another matter. [1] suggests there are some issues with that.

[1] http://stackoverflow.com/questions/5641997/is-it-necessary-t...

2 comments

The only browser to still have an issue with this should be MSIE, and that should be resolved with IE10 which will feature an HTML5 parser[0]: http://blogs.msdn.com/b/ie/archive/2011/07/06/html5-parsing-...

All other major browsers have already switched to an HTML5 parser

* Firefox since Firefox 4: http://hacks.mozilla.org/2010/05/firefox-4-the-html5-parser-...

* Webkit since ~early 2011: http://www.webkit.org/blog/1273/the-html5-parsing-algorithm/ I don't have the exact dates for stable versions of Chrome and Safari

* Opera since December 2011: http://www.opera.com/docs/changelogs/windows/1160/

[0] "html5 parser" is used as a shortcut for "parser implementing the HTML5 parsing algorithm"

Exactly. Combined with the `Link` HTTP header, it’s even possible to apply CSS to a completely empty HTML document! http://mathiasbynens.be/notes/css-without-html