-
Notifications
You must be signed in to change notification settings - Fork 2
/
a11y.html
106 lines (90 loc) · 3.93 KB
/
a11y.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
<!--
This is a sample html doc with as much accessibility markup as I could think of
Examples include:
- proper html elements (header, nav, main, etc)
- aria-label attribute to properly label a region
- aria-label: use the former when it’s not possible to have the label visible on screen
- aria-labelledby: use the latter if the text is visually on-screen somewhere
- lang="en" for html element
- aria-current for page navigation
- roles for certain html elements
This is a working doc. It needs improvement. Great site for notes: http://web-accessibility.carnegiemuseums.org/
-->
<!doctype html>
<html lang="en">
<head>
<!--
width=device-width
Using the meta viewport value `width=device-width` instructs the page to
match the screen's width in device-independent pixels. This allows the
page to reflow content to match different screen sizes, whether rendered
on a small mobile phone or a large desktop monitor.
initial-scale=1
Some browsers keep the page's width constant when rotating to landscape mode,
and zoom rather than reflow to fill the screen. Adding the attribute
initial-scale=1 instructs browsers to establish a 1:1 relationship between
CSS pixels and device-independent pixels regardless of device orientation,
and allows the page to take advantage of the full landscape width.
Note: To ensure that older browsers can properly parse the attributes,
use a comma to separate attributes.
-->
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<header role="banner">
<nav role="navigation" aria-label="Main Navigation">
<ul>
<li><a href="/" aria-current="page">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</nav>
<div class="hamburger" role="button" aria-label="Mobile Navigation Button"> <!-- or just <button> with no role attr -->
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</header>
<main role="main">
<section role="region">
<article>
<h1>My Cool Website</h1>
<p>Welcome to my cool website!</p>
</article>
</section>
<section role="region">
Please complete this form:
<form role="form">
<label for="name">
Name:
<input id="name" type="text" name="name" />
</label>
<fieldset>
<legend>
<h2>Choose your favorite Color</h2>
</legend>
<label for="red">
<input type="checkbox" id="red" name="colors" />
</label>
<label for="orange">
<input type="checkbox" id="orange" name="colors" />
</label>
<label for="yellow">
<input type="checkbox" id="yellow" name="colors" />
</label>
</fieldset>
<input type="submit" value="Submit" />
</form>
</section>
</main>
<aside role="complementary">
<img src="/selfie.jpg" alt="selfie of author" />
</aside>
<footer role="contentinfo" aria-label="Footer Navigation">
<ul>
... same as header ...
</ul>
</footer>
</body>
</html>