Skip to content

Commit 973b845

Browse files
committed
Docs: Make minor improvments in html.md
1 parent 4fca586 commit 973b845

File tree

1 file changed

+35
-16
lines changed

1 file changed

+35
-16
lines changed

doc/html.md

+35-16
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,24 @@ table of contents](TOC.md)
33

44
# The HTML
55

6-
## The `no-js` class
6+
By default, HTML5 Boilerplate provides two `html` pages:
77

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
1021
FOUC](http://paulirish.com/2009/avoiding-the-fouc-v3/).
1122

23+
1224
## Language attribute
1325

1426
Please consider specifying the language of your content by adding the `lang`
@@ -18,22 +30,29 @@ attribute to `<html>` as in this example:
1830
<html class="no-js" lang="en">
1931
```
2032

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
2248

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">`):
3151

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)
3455

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").
3756

3857
## X-UA-Compatible
3958

0 commit comments

Comments
 (0)