Document structure
The HTML document
Goal: Write the standard skeleton of every page · 8 min
Every page shares the same skeleton:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page title</title>
</head>
<body>
visible content
</body>
</html>
<!DOCTYPE html>switches browsers to standards mode.langtells screen readers and translators which language the text is in (defor German).<head>holds metadata: character encoding, viewport for mobile, the title shown in tabs and search results, links to CSS.<body>holds everything visible.
Worked example: A minimal German page
- lang="de" for correct pronunciation by screen readers.
- charset utf-8 so that ä, ö, ü and ß display correctly.
- A descriptive title for the browser tab.
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>Über uns</title>
</head>
<body>
<h1>Über uns</h1>
</body>
</html>