Web - HTML Document Structure
Code Life
By Pierre Marsaa
Introduction to HTML Document Structure
Every HTML document follows a standard structure that helps browsers understand and display the content correctly. Let's explore the basic structure of an HTML document:
↗️
Loading editor...
↶
↷
Let's break down the key parts:
- The <!DOCTYPE html> declaration tells the browser this is an HTML5 document
- The <html> element is the container for all other HTML elements
- The <head> element contains meta-information about the document (explained below)
- The <title> element specifies the title of the document (shown in browser tabs)
- The <body> element contains the visible content of the page
Proper Nesting
HTML elements must be properly nested - meaning that elements must be closed in the reverse order of how they were opened.
Meta-information?
Meta-information are data that are not displayed on the page, but provide information about the page. Such as title, author, viewport settings. Browsers and search engines use this information to better understand the page.
Verify