-
Notifications
You must be signed in to change notification settings - Fork 4
/
headings.html
177 lines (173 loc) · 14.6 KB
/
headings.html
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Headings</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
<link href="css/training.css" rel="stylesheet" type="text/css">
<style> .really-big {font-size:1.4em; font-weight:bold;color:#000;margin:0;} .big {font-size:1.2em; font-weight:bold;color:#222;margin:0 2em;} .a-little-bigger {font-size:1em; font-weight:bold;color:#444;margin:0 4em;} </style>
</head>
<body><script> (function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o), m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-40224544-1', 'ncsu.edu');
ga('send', 'pageview');</script><a href="#main" title="Skip to main content" class="skip-main">Skip To Main Content</a>
<h1>Headings</h1>
<nav>
<p class="toc">
<label for="toc-menu" class="screen-reader">Table of Contents Menu</label>
<select id="toc-menu">
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/">Table of Contents</option>
<optgroup label="The Nature of What is Required">
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/understand-nature.html">Overview</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/what-accessible-means.html">What Accessibility Means</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/law.html">Accessibility and the Law</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/ada.html">Americans with Disabilities Act</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/508.html">Section 508</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/wcag.html">WCAG 2</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/vpat.html">VPAT</option>
</optgroup>
<optgroup label="Choose a technology">
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/technology-overview.html">Overview</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/technology-html.html">HTML</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/technology-pdf.html">PDF</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/technology-office.html">Office Documents</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/technology-rich-media.html">Rich Media</option>
</optgroup>
<optgroup label="Some Basics">
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/basics-overview.html">Overview</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/language.html">Language</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/valid-code.html">Valid Code</option>
</optgroup>
<optgroup label="Document Structure">
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/headings.html">Headings</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/aria-landmarks.html">ARIA Landmarks</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/lists.html">Lists</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/tables.html">Tables</option>
</optgroup>
<optgroup label="User Interactions">
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/mouse-and-keyboard-events.html">Mouse and Keyboard Events</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/visual-focus.html">Visual Focus</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/menus.html">Menus</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/skip-to-main-content.html">Skip to Main Content Links</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/forms.html">Forms</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/color-contrast.html">Color Contrast</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/links.html">Links</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/link-new-window.html">Links Opening in New Windows</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/link-text-alt.html">Text or Alt Attribute for Links</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/link-internal.html">Internal Links</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/link-behavior.html">Link vs. Button</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/link-text-descriptive-target.html">Using Descriptive Link Text</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/link-text-length.html">Length of Link Text</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/link-text-unique.html">Unique Link Text</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/link-text-url.html">URL Text</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/link-underline.html">Underline Style for Links</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/find-content-multiple.html">Finding Content in Multiple Ways</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/timed-events.html">Timed Events</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/aria-checkbox.html">ARIA Checkbox Tutorial</option>
</optgroup>
<optgroup label="Conveying Through Alternate Senses">
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/alternative-text.html">Alternative Text</option>
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/captioning.html">Captioning</option>
</optgroup>
<optgroup label="Appendices">
<option value="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/testing-tools.html">Appendix A - Testing Tools</option>
</optgroup>
</select>
<input id="go-button" type="button" value="GO" onclick="location = document.getElementById('toc-menu').options[ document.getElementById('toc-menu').selectedIndex].value;">
</p>
<p class="prev"><a href="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/valid-code.html"><img src="images/left-arrow.png" alt="previous" />Valid Code</a></p>
<p class="next"><a href="http://accessibility.oit.ncsu.edu/training/accessibility-handbook/aria-landmarks.html">ARIA Landmarks<img src="images/right-arrow.png" alt="next" /></a></p>
</nav><div id="main" role="main" tabindex="-1">
<nav id="page-contents" role="navigation" aria-labelledby="page-contents-heading">
<h2 id="page-contents-heading">Page Contents</h2>
<ul>
<li><a href="#1"><img src="images/checkmark-small.png" alt="Good Technique" title="Good Technique">Use headings to define the page structure</a></li>
<li><a href="#2"><img src="images/checkmark-small.png" alt="Good Technique" title="Good Technique">Use CSS to style the headings</a></li>
<li><a href="#3"><img src="images/checkmark-small.png" alt="Good Technique" title="Good Technique">General Rules for Applying Headings</a></li>
<li><a href="#4"><img src="images/x-small.png" alt="Bad Technique" title="Bad Technique">Only using styles to denote headings</a></li>
</ul>
</nav>
<p>The first level of structure to add to a page is headings. Headings are used to break up the content into a hierarchical structure much like an outline. Where sighted users can skim a page quickly by reading the visual headlines, a screen reader user can also skim a page by quickly traversing the headings. To semantically define headings simply use heading tags to label the beginning of each section.</p>
<div class="example good">
<h2 id="1"><img src="images/checkmark-small.png" alt="Good Technique" title="Good Technique" />Use headings to define the page structure</h2>
<p>This both creates a semantic structure for your page and it allows screen reader users to be able to navigate by heading and jump from section to section.</p>
<pre class="code"><h1>Our News Site</h1>
<h2>World News</h2>
<h2>National News</h2>
<h3>Hot Topics</h3>
<h3>Politics</h3>
<h2>Science</h2>
<h3>Health</h3>
<h3>Environment</h3>
<h3>Technology</h3>
<h2>Entertainment</h2></pre>
</div>
<div class="example good">
<h2 id="2"><img src="images/checkmark-small.png" alt="Good Technique" title="Good Technique" />Use CSS to style the headings</h2>
<p>If you don't like the way the default heading look, and most of us don't, just use CSS to style the headings.</p>
<pre class="code"><style>
h1 {font-size:1.4em; font-weight:bold; color:#000;}
h2 {font-size:1.2em; font-weight:bold; color:#222;}
h3 {font-size:1em; font-weight:bold; color:#444;}
</style>
<h1>Our News Site</h1>
<h2>World News</h2>
<h2>National News</h2>
<h3>Hot Topics</h3>
<h3>Politics</h3>
<h2>Science</h2>
<h3>Health</h3>
<h3>Environment</h3>
<h3>Technology</h3>
<h2>Entertainment</h2></pre>
</div>
<h2 id="3">General Rules for Applying Headings</h2>
<ul>
<li>Your <h1> should be where the unique main content of your page begins, which usually means it will come after your navigation system.</li>
<li>It is fine if your first heading on the page is not an <h1>, such as a having an <h2> come before your first <h1></li>
<li>You should have only 1 <h1> per page. If you feel you must, you can use a second <h1> for the title of your page.</li>
<li>Don’t obsess over making the first heading on your page an <h1>.</li>
<li>Don’t pick a heading level simply for font sizing purposes. Pick a level that corresponds roughly to the outline of the page.</li>
<li>It is not usually necessary to skip heading levels, going from an <h1> directly to an <h3>.</li>
<li>There are always exceptions to rules. Just make sure you are breaking the rules for a good reason.</li>
</ul>
<div class="example bad">
<h2 id="4"><img src="images/x-small.png" alt="Bad Technique" title="Bad Technique" />Only using styles to denote headings</h2>
<p>Do not use stylings as the only way to communicate what your headings are. This works for visual users, but screen reader users will not be able to easily divide your page into logical structures.</p>
<pre class="code"><style>
.really-big {font-size:1.4em; font-weight:bold; color:#000; margin:0;}
.big {font-size:1.2em; font-weight:bold; color:#222; margin:0 2em;}
.a-little-bigger {font-size:1em; font-weight:bold; color:#444; margin:0 4em;}
</style>
<p class="really-big">Our News Site</p>
<p class="big">World News</p>
<p class="big">National News</p>
<p class="a-little-bigger">Hot Topics</p>
<p class="a-little-bigger">Politics</p>
<p class="big">Science</p>
<p class="a-little-bigger">Health</p>
<p class="a-little-bigger">Environment</p>
<p class="a-little-bigger">Technology</p>
<p class="big">Entertainment</p></pre>
<h3>Implementation</h3>
<p class="really-big">Our News Site</p>
<p class="big">World News</p>
<p class="big">National News</p>
<p class="a-little-bigger">Hot Topics</p>
<p class="a-little-bigger">Politics</p>
<p class="big">Science</p>
<p class="a-little-bigger">Health</p>
<p class="a-little-bigger">Environment</p>
<p class="a-little-bigger">Technology</p>
<p class="big">Entertainment</p>
</div>
</div></body>
</html>