Skip to main content

Document Skeleton and DOCTYPE

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Example</title>
</head>
<body>
<h1>Hello</h1>
</body>
</html>

Key Parts

PartPurpose
<!doctype html>Enables modern standards mode
<html>Root document element
<head>Metadata and resources
<body>Rendered content

Rules

  • Put the doctype first.
  • Keep visible content inside <body>.
  • Declare a language on <html>.

What's Next