summaryrefslogtreecommitdiff
path: root/Document structure.md
blob: 267449307b1a67f5aa3ebe6ff4f716fa14b83951 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
tags:
  - html
  - web
---
This describes [[HTML]] document structure.

**Mandatory**
```
<!DOCTYPE html>
<html>
<head lang="nl">
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width" />
  <title></title>
</head>
<body>
</body>
</html>
```

[lang attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang#language_tag_syntax) region is option (e.g nl-NL), we can just say nl. The lang attribute can be used on any part that contains text, to denote a different locale from the main one.

**Charset must come before title** and it makes sure the browser can render text correctly.

The **head** element is the place to load [[CSS]] it contains:
- [[Link elements]]
- [[Script elements]]
- [[Base elements]]
- [[Meta elements]]