← HTML Fundamentals
HTML foundations · 15 MIN

Document structure and metadata

Document structure and metadata

The doctype selects modern standards mode. The html element is the root; head contains metadata and linked resources; body contains visible content. Set the document language, character encoding, title and viewport so browsers and assistive technology can interpret the page.

Try it yourself

Change the example, run it, and explain the result in your own words. Then create one variation of your own.

Key idea

Use the example as a starting point, not something to memorize. Practise, inspect the result and make small improvements.

Code example

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A short page description">