@@ -3,12 +3,24 @@ table of contents](TOC.md)
3
3
4
4
# The HTML
5
5
6
- ## The ` no-js ` class
6
+ By default, HTML5 Boilerplate provides two ` html ` pages:
7
7
8
- Allows you to more easily explicitly add custom styles when JavaScript is
9
- disabled (` no-js ` ) or enabled (` js ` ). More here: [ Avoiding the
8
+ * [ ` index.html ` ] ( #indexhtml ) - a default HTML skeleton that should form the
9
+ basis of all pages on your website
10
+ * [ ` 404.html ` ] ( #404html ) - a placeholder 404 error page
11
+
12
+
13
+ ## ` index.html `
14
+
15
+
16
+ ### The ` no-js ` class
17
+
18
+ The ` no-js ` class is provided in order to allow you to more easily and
19
+ explicitly add custom styles based on whether JavaScript is disabled
20
+ (` .no-js ` ) or enabled (` .js ` ). Using this technique also helps [ avoid the
10
21
FOUC] ( http://paulirish.com/2009/avoiding-the-fouc-v3/ ) .
11
22
23
+
12
24
## Language attribute
13
25
14
26
Please consider specifying the language of your content by adding the ` lang `
@@ -18,22 +30,29 @@ attribute to `<html>` as in this example:
18
30
<html class =" no-js" lang =" en" >
19
31
```
20
32
21
- ## The order of meta tags, and ` <title> `
33
+ ### The order of the ` <title> ` and ` <meta> ` tags
34
+
35
+ The order in which the ` <title> ` and the ` <meta> ` tags are specified is
36
+ important because:
37
+
38
+ 1 ) the charset declaration (` <meta charset="utf-8"> ` ):
39
+
40
+ * must be included completely within the [ first 1024 bytes of the
41
+ document] ( http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset )
42
+
43
+ * should be specified as early as possbile (before any content that could
44
+ be controlled by an attacker, such as a ` <title> ` element) in order to
45
+ avoid a potential [ encoding-related security
46
+ issue] ( http://code.google.com/p/doctype-mirror/wiki/ArticleUtf7 ) in
47
+ Internet Explorer
22
48
23
- As recommended by [ the HTML5
24
- spec] ( http://www.whatwg.org/specs/web-apps/current-work/complete/semantics.html#charset )
25
- (4.2.5.5 Specifying the document's character encoding), add your charset
26
- declaration early (before any ASCII art ;) to avoid a potential
27
- [ encoding-related security
28
- issue] ( http://code.google.com/p/doctype-mirror/wiki/ArticleUtf7 ) in IE. It
29
- should come in the first [ 1024
30
- bytes] ( http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset ) .
49
+ 2 ) the meta tag for compatibility mode
50
+ (` <meta http-equiv="X-UA-Compatible" content="IE=edge"> ` ):
31
51
32
- The charset should also come before the ` <title> ` tag, due to [ potential XSS
33
- vectors] ( http://code.google.com/p/doctype-mirror/wiki/ArticleUtf7 ) .
52
+ * [ needs to be included before all other tags except for the ` <title> ` and
53
+ the other ` <meta> `
54
+ tags] ( http://msdn.microsoft.com/en-us/library/cc288325.aspx )
34
55
35
- The meta tag for compatibility mode [ needs to be before all elements except
36
- title and meta] ( http://h5bp.com/f " Defining Document Compatibility - MSDN ") .
37
56
38
57
## X-UA-Compatible
39
58
0 commit comments