Back to course

Lesson 3: The Basic HTML Document Structure

The HTML Masterclass: From Zero to Web Developer

3. The Basic HTML Document Structure

Every professional HTML document follows a required basic structure. You must memorize these four core components.

3.1 The Four Core Components

html

Component Breakdown:

  1. <!DOCTYPE html>: This declaration must be the very first thing in your HTML document. It tells the browser that this document is an HTML5 document.
  2. <html>: This is the root element. Everything else in the document must be contained within this tag.
  3. <head>: This section contains metadata—information about the HTML document that is not displayed on the page itself (like the character set, links to stylesheets, and the title).
  4. <body>: This section contains all the visible content of the page: text, images, videos, links, etc.

The Document Title

The <title> element, placed inside the <head>, sets the text that appears on the browser tab or window frame.

html