Head: Omissions

By HTML5 standards, the <html> tag, the <body> tag, and the <head> tag can be omitted, to reduce the complexity of the HTML document. When the <head> tag is omitted, browsers will create a default <head> element before the <body> tag.The following code will validate as HTML5:

HTML file: Displayed by browser:
<!DOCTYPE html>
  <title>Page Title</title>
    <h1>This is a heading</h1>
    <p>This is a paragraph.</p>

(end of document)
Page Title

This is a heading

This is a paragraph.

Take note that the <html> element is the document root, and the recommended place for specifying the page language. Declaring a language is important for accessibility applications (screen readers) and search engines:

<!DOCTYPE html>
<html lang="en-US">

Omitting these tags is not recommended! Omitting them can crash badly-written DOM/XML software or produce errors in older browsers (IE9).

Back button Table of Contents Next button