Is it necessary to write ,
and
tags?
For example, I can make such a page:
It's true that the HTML specs permit certain tags to be omitted in certain cases, but generally doing so is unwise.
It has two effects - it makes the spec more complex, which in turn makes it harder for browser authors to write correct implementations (as demonstrated by IE getting it wrong).
This makes the likelihood of browser errors in these parts of the spec high. As a website author you can avoid the issue by including these tags - so while the spec doesn't say you have to, doing so reduces the chance of things going wrong, which is good engineering practice.
What's more, the latest HTML 5.1 WG spec currently says (bear in mind it's a work in progress and may yet change).
A body element's start tag may be omitted if the element is empty, or if the first thing inside the body element is not a space character or a comment, except if the first thing inside the body element is a meta, link, script, style, or template element.
http://www.w3.org/html/wg/drafts/html/master/sections.html#the-body-element
This is a little subtle. You can omit body and head, and the browser will then infer where those elements should be inserted. This carries the risk of not being explicit, which could cause confusion.
So this
hello