‹ BACK

Omitting the html, head, and body tags

Omitting the html, head, and body tags is certainly allowed by the HTML specs. The underlying reason is that browsers have always sought to be consistent with existing web pages, and the very early versions of HTML didn't define those elements. When HTML 2.0 first did, it was done in a way that the tags would be inferred when missing.
In the HTML5 standard, the <html> tag, the <body> tag, and the <head> tag can be omitted. The following code will validate as HTML5:
<!DOCTYPE html>
<title>Page Title</title>
<h1>This is a heading</h1>

<p>
This is a paragraph.
</p>

More details: Stackoverflow: Is it necessary to write HEAD, BODY and HTML tags?
body-tag html-tag head-tag omitting-tags

To check your knowledge the following tests are recommended:
Check your htmlcss htmlcss skills.