I've just been reading the HTML5 author spec.
It states that the <html>
, <head>
and <body>
tags are optional.
Does that mean that you can leave them out completely and still have a valid HTML5 document?
If I'm interpreting this correctly, it means this should be completely valid:
<!DOCTYPE html>
<p>Hello!</p>
Is this correct?
You can check out the spec here:
http://dev.w3.org/html5/spec-author-view/syntax.html#syntax
"8.1.2.4 Optional tags" is the bit out about it being OK to omit <html>
, <head>
and <body>
<title></title>
tags on the second line, it passes the validation. – Cyrilcyrill<html>
tag, as written in your link : "Documents must consist of [...] The root element, in the form of an html element." For<head>
and<body>
, I'll have a look. – Eugenieeugenio