Document Structure
Build the complete shell every standards-friendly HTML page needs.
A complete page includes metadata for the browser and a body for visible content. This predictable shell helps browsers, search engines, and accessibility tools interpret the document correctly.
The page skeleton
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>My learning journal</title>
</head>
<body>
<h1>My learning journal</h1>
</body>
</html>
The doctype selects standards mode. lang identifies the document language. UTF-8 supports modern text, and the viewport declaration lets mobile browsers use the device width.
Head and body
The head contains information about the page: its title, description, icons, styles, and other metadata. The body contains everything rendered as page content.
<head>
<title>Journal · Ada</title>
<meta name="description" content="Notes from Ada's web-learning journey." />
</head>
Nest cleanly
Elements must be nested, not crossed. Indentation is optional to the browser but essential for readers.
<main>
<article>
<h1>A clear document</h1>
<p>Each child closes before its parent.</p>
</article>
</main>
Keep this
Use one document shell per page, declare its language, keep metadata in head, and place visible content in body.