CONTENTS
Introduction
ix
CHAPTER 1 Main structure
1
The <head> . . . . . . . . . . . . . . . . . . . . . . 2
Using new HTML5 structural elements . . . . . . . . . 6
Styling HTML5 with CSS . . . . . . . . . . . . . . . . 10
When to use the new HTML5 structural
elements . . . . . . . . . . . . . . . . . . . . . . 13
Summary . . . . . . . . . . . . . . . . . . . . . . 21
CHAPTER 2
Text
23
Structuring main content areas . . . . . . . . . . . 24
Adding blogposts and comments . . . . . . . . . . 29
Working with HTML5 outlines . . . . . . . . . . . . . 30
Understanding WAI-ARIA . . . . . . . . . . . . . . 48
Even more new structures! . . . . . . . . . . . . . . 51
Redefi ned elements . . . . . . . . . . . . . . . . . 56
Global attributes. . . . . . . . . . . . . . . . . . . 61
Features not covered in this book . . . . . . . . . . 64
Summary . . . . . . . . . . . . . . . . . . . . . . 66
CHAPTER 3
Forms
67
We
HTML, and now it
s us back . . . . . . . . . 68
New input types . . . . . . . . . . . . . . . . . . . 68
CONTENTS
vi
New attributes . . . . . . . . . . . . . . . . . . . . 74
Putting all this together . . . . . . . . . . . . . . . 79
Backwards compatibility with legacy browsers . . . 82
Styling new form fi elds and error messages . . . . . 83
Overriding browser defaults . . . . . . . . . . . . . 84
Using JavaScript for DIY validation . . . . . . . . . 85
Avoiding validation . . . . . . . . . . . . . . . . . 86
Summary . . . . . . . . . . . . . . . . . . . . . . 89
CHAPTER 4 Video and Audio
91
Native multimedia: why, what, and how? . . . . . . 92
Codecs—the horror, the horror . . . . . . . . . . . 98
Rolling custom controls . .