|
|
|
|
|
by chrismorgan
1396 days ago
|
|
It’s not that you’re allowed to omit the head element (you’re not, and you can’t), but that its start and end tags are optional. Same with the html and body elements. (These remarks apply to HTML syntax only; in XML syntax, which is certainly still a thing, you can (if you care not for validity) omit whatever elements you choose to, only needing some root element.) As far as sources are concerned, the HTML spec is maintained by WHATWG, not W3C. The relevant citations start at https://html.spec.whatwg.org/multipage/semantics.html#docume.... The normative reference on the necessity of <title> is in the content model for the head element: > If the document is an `iframe srcdoc` document or if title information is available from a higher-level protocol: Zero or more elements of metadata content, of which no more than one is a `title` element and no more than one is a `base` element. > Otherwise: One or more elements of metadata content, of which exactly one is a `title` element and no more than one is a `base` element. For the rest, you’re correct: the DOCTYPE is the only always-mandatory thing in a valid HTML document. |
|
That’s like calling a cheese sandwich without any cheese a cheese sandwich.