Skip to main content
Albero Academy

Document Structure

The boilerplate every HTML page starts with.

Foundations8 min

Every HTML document follows the same skeleton. Knowing each part means you can start any page from scratch and understand any page you read.

The skeleton

a complete HTML page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Page</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is my first web page.</p>
</body>
</html>

What each part does

  • <!DOCTYPE html> — declares this is HTML5.
  • <html> — the root element (set lang for accessibility/SEO).
  • <head> — metadata: title, charset, viewport, links (not visible on the page).
  • <body> — the visible content of the page.

Key takeaways

  1. 01Every page: <!DOCTYPE html>, <html>, <head>, <body>.
  2. 02<!DOCTYPE html> declares HTML5; set lang on <html>.
  3. 03The <head> holds metadata (title, charset, viewport); the <body> holds visible content.
  4. 04The viewport meta tag is essential for correct mobile rendering.

Finished this chapter?

Mark it complete to track your progress through HTML.