Skip to content

Web development

HTML document structure

The doctype, html, head and body give a client’s page a recognizable document structure.

Leah opens a client's web page file to update it. The whole file is one line: an h1 heading that reads Custom Furniture. What else belongs in a complete HTML file?

Start the lesson

4 minutes. No sign-up needed.

What you'll learn5 ideas
  • The doctype, <!DOCTYPE html>, goes at the very top of the file and tells the browser to use modern HTML rules.
  • Browsers fill in missing structure on their own, so a page that looks fine doesn't prove its file is complete.
  • The html element starts right after the doctype and closes at the end, with every other element between its tags.
  • The head element holds information for the browser, and the body element holds everything visitors see.
  • Inside html, head comes first and body right after it, with neither one inside the other.
Chapter 1: Structuring web pages with HTML7 lessons · 27 min

This lesson is part of the Web development course.

Example plan3 lessons · 11 min

HTML element nesting4 min
HTML document structureStructuring web pages with HTML4 min
HTML headings and paragraphsStructuring web pages with HTML3 min

An example. Your plan follows your answers, so it can start later and end sooner.

Build my plan

Start free, no account needed.