SyntaxStudy
Sign Up
HTML HTML Document Structure
HTML Beginner 1 min read

HTML Document Structure

HTML Document Structure

Every HTML document follows a standard structure. Understanding this is fundamental to writing correct HTML.

Required Parts

  • <!DOCTYPE html> — Declares the document as HTML5
  • <html> — Root element of the page
  • <head> — Meta-information (not visible on page)
  • <body> — Everything visible on the page

The <head> Element

The <head> section holds metadata:

  • <title> — Browser tab title
  • <meta charset="UTF-8"> — Character encoding
  • <meta name="viewport" ...> — Mobile responsiveness
  • <link> — Links to CSS files
Example
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Page Title</title>
</head>
<body>
  <h1>Visible Content Goes Here</h1>
</body>
</html>