├── .gitignore
├── .gitmodules
├── CODE_OF_CONDUCT.md
├── Gemfile
├── Gemfile.lock
├── README.md
├── _config.yml
├── _config_staging.yml
├── _data
├── lang.json
├── navigation.yaml
├── techniques.yml
├── translations.yml
└── wcag.yml
├── content-images
└── wai-tutorials
│ ├── carousels
│ ├── carousels-paging-buttons.png
│ ├── carousels-styling-contrast.png
│ ├── chevron-left.png
│ ├── chevron-right.png
│ ├── ex-teddy1.jpg
│ ├── ex-teddy2.jpg
│ └── ex-teddy3.jpg
│ ├── forms
│ └── zxcvbn.js
│ ├── html5-badge-h-css3-graphics-multimedia-semantics.png
│ ├── images
│ ├── bad-top-text.png
│ ├── castle-etching.jpg
│ ├── castle-fluro.jpg
│ ├── castle-painting.jpg
│ ├── chart.png
│ ├── counter-clockwise.jpg
│ ├── crocus.jpg
│ ├── dog.jpg
│ ├── family.jpg
│ ├── fax.png
│ ├── harbarbarahand.ttf
│ ├── html5logo.png
│ ├── kew.jpg
│ ├── new-window.png
│ ├── orgchart.png
│ ├── pdfdocument.png
│ ├── peafowl.jpg
│ ├── phone.png
│ ├── print.png
│ ├── repeat1.png
│ ├── searchbutton.png
│ ├── sleeping.jpg
│ ├── star-empty.png
│ ├── star-full.png
│ ├── star-half.png
│ ├── topinfo_bg.png
│ ├── w3c.png
│ ├── wai.png
│ └── worddocument.png
│ ├── menus
│ ├── ex-dropdown-active.png
│ └── ex-dropdown-inactive.png
│ ├── page-structure
│ ├── page-structure-aside.png
│ ├── page-structure-aside@2x.png
│ ├── page-structure-aside@3x.png
│ ├── page-structure-footer.png
│ ├── page-structure-footer@2x.png
│ ├── page-structure-footer@3x.png
│ ├── page-structure-header.png
│ ├── page-structure-header@2x.png
│ ├── page-structure-header@3x.png
│ ├── page-structure-headings-2.png
│ ├── page-structure-headings-2@2x.png
│ ├── page-structure-headings-2@3x.png
│ ├── page-structure-headings-intro.png
│ ├── page-structure-headings-intro@2x.png
│ ├── page-structure-headings-intro@3x.png
│ ├── page-structure-headings.png
│ ├── page-structure-headings@2x.png
│ ├── page-structure-headings@3x.png
│ ├── page-structure-main.png
│ ├── page-structure-main@2x.png
│ ├── page-structure-main@3x.png
│ ├── page-structure-navigation.png
│ ├── page-structure-navigation@2x.png
│ └── page-structure-navigation@3x.png
│ └── tables
│ ├── headers-in-one-column-all-data-in-second.png
│ ├── img-caption.png
│ ├── img-caption.svg
│ ├── img-irreg.png
│ ├── img-irreg.svg
│ ├── img-multi.png
│ ├── img-multi.svg
│ ├── img-multidir.png
│ ├── img-multidir.svg
│ ├── img-scope.png
│ ├── img-simple.png
│ ├── img-simple.svg
│ └── table-text-resize.png
├── content
├── acknowledgements.md
├── carousels
│ ├── animations.md
│ ├── examples
│ │ ├── carousel.js
│ │ └── focusinoutpolyfill.js
│ ├── full-code.md
│ ├── functionality.md
│ ├── index.md
│ ├── structure.md
│ ├── styling.md
│ └── working-example.md
├── changelog.md
├── forms
│ ├── custom-controls.md
│ ├── examples
│ │ └── password.md
│ ├── grouping.md
│ ├── index.md
│ ├── instructions.md
│ ├── labels.md
│ ├── multi-page.md
│ ├── notifications.md
│ └── validation.md
├── images
│ ├── complex.md
│ ├── decision-tree.de.md
│ ├── decision-tree.fr.md
│ ├── decision-tree.id.md
│ ├── decision-tree.ja.md
│ ├── decision-tree.ko.md
│ ├── decision-tree.md
│ ├── decorative.md
│ ├── examples
│ │ ├── 2014-first-qtr.md
│ │ └── imagemap.md
│ ├── functional.md
│ ├── groups.md
│ ├── imagemap.md
│ ├── index.md
│ ├── informative.md
│ ├── textual.md
│ └── tips.md
├── index.md
├── menus
│ ├── application-menus-code.md
│ ├── application-menus.md
│ ├── flyout.md
│ ├── index.md
│ ├── structure.md
│ └── styling.md
├── page-structure
│ ├── content.md
│ ├── example.md
│ ├── headings.md
│ ├── index.md
│ ├── labels.md
│ └── regions.md
└── tables
│ ├── caption-summary.md
│ ├── examples
│ ├── headertoprow.md
│ ├── headertoprowfirstcol.md
│ ├── multiplecolumnheaders.md
│ ├── scope-multiple.md
│ ├── scope-offset.md
│ ├── scope-simple.md
│ └── threeheaders.md
│ ├── index.md
│ ├── irregular.md
│ ├── multi-level.md
│ ├── one-header.md
│ ├── tips.md
│ └── two-headers.md
├── netlify.toml
└── w3c.json
/.gitignore:
--------------------------------------------------------------------------------
1 | _site
2 | .sass-cache
3 | .jekyll-*
4 | .DS_Store
5 | .nosync
6 | .ruby-version
7 |
8 | # Local Netlify folder
9 | .netlify
10 | .vscode
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "_external/data"]
2 | path = _external/data
3 | url = https://github.com/w3c/wai-website-data.git
4 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | All documentation, code and communication under this repository are covered by the [W3C Code of Ethics and Professional Conduct](https://www.w3.org/Consortium/cepc/).
4 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | gem "wai-gems", :path => "_external/data/wai-gems"
4 |
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | PATH
2 | remote: _external/data/wai-gems
3 | specs:
4 | wai-gems (1.0.0)
5 | jekyll-github-metadata
6 | jekyll-include-cache
7 | jekyll-paginate
8 | jekyll-redirect-from
9 | jekyll-relative-links
10 | jekyll-remote-theme
11 | jekyll-seo-tag
12 | jekyll-sitemap
13 | wai-website-plugin
14 |
15 | GEM
16 | remote: https://rubygems.org/
17 | specs:
18 | addressable (2.8.7)
19 | public_suffix (>= 2.0.2, < 7.0)
20 | bigdecimal (3.1.8)
21 | colorator (1.1.0)
22 | concurrent-ruby (1.3.3)
23 | em-websocket (0.5.3)
24 | eventmachine (>= 0.12.9)
25 | http_parser.rb (~> 0)
26 | eventmachine (1.2.7)
27 | faraday (2.9.2)
28 | faraday-net_http (>= 2.0, < 3.2)
29 | faraday-net_http (3.1.0)
30 | net-http
31 | ffi (1.17.0-arm64-darwin)
32 | ffi (1.17.0-x86_64-linux-gnu)
33 | forwardable-extended (2.6.0)
34 | google-protobuf (4.27.2-arm64-darwin)
35 | bigdecimal
36 | rake (>= 13)
37 | google-protobuf (4.27.2-x86_64-linux)
38 | bigdecimal
39 | rake (>= 13)
40 | http_parser.rb (0.8.0)
41 | i18n (1.14.5)
42 | concurrent-ruby (~> 1.0)
43 | jekyll (4.3.3)
44 | addressable (~> 2.4)
45 | colorator (~> 1.0)
46 | em-websocket (~> 0.5)
47 | i18n (~> 1.0)
48 | jekyll-sass-converter (>= 2.0, < 4.0)
49 | jekyll-watch (~> 2.0)
50 | kramdown (~> 2.3, >= 2.3.1)
51 | kramdown-parser-gfm (~> 1.0)
52 | liquid (~> 4.0)
53 | mercenary (>= 0.3.6, < 0.5)
54 | pathutil (~> 0.9)
55 | rouge (>= 3.0, < 5.0)
56 | safe_yaml (~> 1.0)
57 | terminal-table (>= 1.8, < 4.0)
58 | webrick (~> 1.7)
59 | jekyll-github-metadata (2.16.1)
60 | jekyll (>= 3.4, < 5.0)
61 | octokit (>= 4, < 7, != 4.4.0)
62 | jekyll-include-cache (0.2.1)
63 | jekyll (>= 3.7, < 5.0)
64 | jekyll-paginate (1.1.0)
65 | jekyll-redirect-from (0.16.0)
66 | jekyll (>= 3.3, < 5.0)
67 | jekyll-relative-links (0.7.0)
68 | jekyll (>= 3.3, < 5.0)
69 | jekyll-remote-theme (0.4.3)
70 | addressable (~> 2.0)
71 | jekyll (>= 3.5, < 5.0)
72 | jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
73 | rubyzip (>= 1.3.0, < 3.0)
74 | jekyll-sass-converter (3.0.0)
75 | sass-embedded (~> 1.54)
76 | jekyll-seo-tag (2.8.0)
77 | jekyll (>= 3.8, < 5.0)
78 | jekyll-sitemap (1.4.0)
79 | jekyll (>= 3.7, < 5.0)
80 | jekyll-watch (2.2.1)
81 | listen (~> 3.0)
82 | kramdown (2.4.0)
83 | rexml
84 | kramdown-parser-gfm (1.1.0)
85 | kramdown (~> 2.0)
86 | liquid (4.0.4)
87 | listen (3.9.0)
88 | rb-fsevent (~> 0.10, >= 0.10.3)
89 | rb-inotify (~> 0.9, >= 0.9.10)
90 | mercenary (0.4.0)
91 | net-http (0.4.1)
92 | uri
93 | octokit (6.1.1)
94 | faraday (>= 1, < 3)
95 | sawyer (~> 0.9)
96 | pathutil (0.16.2)
97 | forwardable-extended (~> 2.6)
98 | public_suffix (6.0.0)
99 | rake (13.2.1)
100 | rb-fsevent (0.11.2)
101 | rb-inotify (0.11.1)
102 | ffi (~> 1.0)
103 | rexml (3.3.1)
104 | strscan
105 | rouge (4.3.0)
106 | rubyzip (2.3.2)
107 | safe_yaml (1.0.5)
108 | sass-embedded (1.77.5)
109 | google-protobuf (>= 3.25, < 5.0)
110 | rake (>= 13)
111 | sass-embedded (1.77.5-arm64-darwin)
112 | google-protobuf (>= 3.25, < 5.0)
113 | sawyer (0.9.2)
114 | addressable (>= 2.3.5)
115 | faraday (>= 0.17.3, < 3)
116 | strscan (3.1.0)
117 | terminal-table (3.0.2)
118 | unicode-display_width (>= 1.1.1, < 3)
119 | unicode-display_width (2.5.0)
120 | uri (0.13.0)
121 | wai-website-plugin (0.2)
122 | jekyll (>= 3.6, < 5.0)
123 | webrick (1.8.1)
124 |
125 | PLATFORMS
126 | x86_64-linux
127 |
128 | DEPENDENCIES
129 | wai-gems!
130 |
131 | BUNDLED WITH
132 | 2.5.14
133 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | > [!IMPORTANT]
2 | > This repository has been archived 11 July 2024.
3 | >
4 | > [Tutorials](https://www.w3.org/WAI/tutorials/) are now edited in the [wai-website](https://github.com/w3c/wai-website) repository.
5 |
6 | ## Archived information
7 |
8 | ### Publication branch
9 |
10 | The branch deployed to the website is the `publication` branch. More info on requesting deploys is in [Updating WAI Website Resources](https://wai-website-theme.netlify.app/workflow/)
11 |
12 | ### Translation Notes
13 |
14 | See [Resource-Specific Translation Instructions](https://www.w3.org/WAI/about/translating/resources/resource-specific-instructions/#tutorials-including-an-alt-decision-tree)
15 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | # Welcome to Jekyll!
2 | #
3 | # This config file is meant for settings that affect your whole blog, values
4 | # which you are expected to set up once and rarely need to edit after that.
5 | # For technical reasons, this file is *NOT* reloaded automatically when you use
6 | # 'jekyll serve'. If you change this file, please restart the server process.
7 |
8 | # Site settings
9 | title: "Web Accessibility Initiative (WAI)"
10 | email: your-email@domain.com
11 | description: > # this means to ignore newlines until "baseurl:"
12 | The Website of the World Wide Web Consortium’s Web Accessibility Initiative.
13 | baseurl: "/tutorials" # the subpath of your site, e.g. /blog
14 | url: "https://w3c.github.io" # the base hostname & protocol for your site
15 | twitter:
16 | username: w3c_wai
17 | author: w3c_wai
18 | exclude:
19 | - "_external"
20 | - "Gemfile"
21 | - "Gemfile.lock"
22 | - "README.md"
23 | - "w3c.json"
24 | - "CODE_OF_CONDUCT.md"
25 |
26 | # Build settings
27 | markdown: kramdown
28 | kramdown:
29 | toc_levels: 2..3
30 | input: GFM
31 | syntax_highlighter: rouge
32 | highlighter: rouge
33 | repository: w3c/wai-tutorials
34 |
35 | ytkey: AIzaSyCiZ9uToWu9jb7BTx47NtzCvmGGXKXp8nI
36 |
37 | remote_theme: w3c/wai-website-theme
38 |
39 | defaults:
40 | - scope:
41 | path: ""
42 | values:
43 | layout: "default"
44 |
45 | plugins:
46 | - jekyll-seo-tag
47 | - jekyll-sitemap
48 | - jekyll-redirect-from
49 | - jekyll-include-cache
50 | - jekyll-paginate
51 | - jekyll-remote-theme
52 | - wai-website-plugin
53 |
--------------------------------------------------------------------------------
/_config_staging.yml:
--------------------------------------------------------------------------------
1 | baseurl: "" # the subpath of your site, e.g. /blog
2 | url: "" # the base hostname & protocol for your site
--------------------------------------------------------------------------------
/_data/lang.json:
--------------------------------------------------------------------------------
1 | ../_external/data/lang.json
--------------------------------------------------------------------------------
/_data/techniques.yml:
--------------------------------------------------------------------------------
1 | ../_external/data/techniques.yml
--------------------------------------------------------------------------------
/_data/translations.yml:
--------------------------------------------------------------------------------
1 | ../_external/data/translations.yml
--------------------------------------------------------------------------------
/_data/wcag.yml:
--------------------------------------------------------------------------------
1 | ../_external/data/wcag.yml
--------------------------------------------------------------------------------
/content-images/wai-tutorials/carousels/carousels-paging-buttons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/carousels/carousels-paging-buttons.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/carousels/carousels-styling-contrast.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/carousels/carousels-styling-contrast.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/carousels/chevron-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/carousels/chevron-left.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/carousels/chevron-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/carousels/chevron-right.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/carousels/ex-teddy1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/carousels/ex-teddy1.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/carousels/ex-teddy2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/carousels/ex-teddy2.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/carousels/ex-teddy3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/carousels/ex-teddy3.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/html5-badge-h-css3-graphics-multimedia-semantics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/html5-badge-h-css3-graphics-multimedia-semantics.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/bad-top-text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/bad-top-text.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/castle-etching.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/castle-etching.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/castle-fluro.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/castle-fluro.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/castle-painting.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/castle-painting.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/chart.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/counter-clockwise.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/counter-clockwise.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/crocus.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/crocus.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/dog.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/dog.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/family.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/family.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/fax.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/fax.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/harbarbarahand.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/harbarbarahand.ttf
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/html5logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/html5logo.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/kew.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/kew.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/new-window.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/new-window.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/orgchart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/orgchart.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/pdfdocument.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/pdfdocument.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/peafowl.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/peafowl.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/phone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/phone.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/print.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/print.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/repeat1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/repeat1.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/searchbutton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/searchbutton.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/sleeping.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/sleeping.jpg
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/star-empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/star-empty.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/star-full.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/star-full.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/star-half.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/star-half.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/topinfo_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/topinfo_bg.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/w3c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/w3c.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/wai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/wai.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/images/worddocument.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/images/worddocument.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/menus/ex-dropdown-active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/menus/ex-dropdown-active.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/menus/ex-dropdown-inactive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/menus/ex-dropdown-inactive.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-aside.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-aside.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-aside@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-aside@2x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-aside@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-aside@3x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-footer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-footer.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-footer@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-footer@2x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-footer@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-footer@3x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-header.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-header@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-header@2x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-header@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-header@3x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-headings-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-headings-2.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-headings-2@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-headings-2@2x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-headings-2@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-headings-2@3x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-headings-intro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-headings-intro.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-headings-intro@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-headings-intro@2x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-headings-intro@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-headings-intro@3x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-headings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-headings.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-headings@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-headings@2x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-headings@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-headings@3x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-main.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-main@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-main@2x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-main@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-main@3x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-navigation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-navigation.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-navigation@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-navigation@2x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/page-structure/page-structure-navigation@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/page-structure/page-structure-navigation@3x.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/headers-in-one-column-all-data-in-second.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/tables/headers-in-one-column-all-data-in-second.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/img-caption.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/tables/img-caption.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/img-caption.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | img-caption
5 | Created with Sketch.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/img-irreg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/tables/img-irreg.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/img-irreg.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | img-irreg
5 | Created with Sketch.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/img-multi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/tables/img-multi.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/img-multi.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | img-multi
5 | Created with Sketch.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/img-multidir.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/tables/img-multidir.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/img-multidir.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | img-multidir
5 | Created with Sketch.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/img-scope.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/tables/img-scope.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/img-simple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/tables/img-simple.png
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/img-simple.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | img-simple
5 | Created with Sketch.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/content-images/wai-tutorials/tables/table-text-resize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3c/wai-tutorials/ef7a612c0014bd1514bcd7e1d8d5f02fa5ed43d7/content-images/wai-tutorials/tables/table-text-resize.png
--------------------------------------------------------------------------------
/content/acknowledgements.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Acknowledgements"
3 | permalink: /tutorials/acknowledgements/
4 | ref: /tutorials/acknowledgements/
5 | lang: en
6 | description:
7 | image: /content-images/wai-tutorials/images/social.png
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/acknowledgements.md'
12 |
13 | resource:
14 | ref: /tutorials/
15 |
16 | footer: >
17 |
Editors: Eric Eggert, Shadi Abou-Zahra. Update Editor: Brian Elton. Contributors: Shawn Lawton Henry, Anna Belle Leiserson, Sharron Rush, Bim Egan, Laura Keen, AG WG participants , EOWG participants .
18 | Developed by the Education and Outreach Working Group (EOWG ). Updated with support from the WCAG Technical Assistance (WCAG TA) project . Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme.
19 |
20 | ---
21 |
22 | The WAI Tutorials were developed by the [Education Outreach Working Group (EOWG)](https://www.w3.org/groups/wg/eowg/) with support from the [WAI-ACT project](https://www.w3.org/WAI/ACT/), co-funded by the European Commission IST Programme.
23 |
24 |
25 | ## Project Leadership
26 | For the initial development and updates:
27 |
28 | - **Project Coordinator:**
29 | - Shadi Abou-Zahra, W3C WAI
30 | - **Editors:**
31 | - **Eric Eggert, W3C WAI**
32 | - Shadi Abou-Zahra, W3C WAI
33 | - **EOWG Co-Chairs:**
34 | - Sharron Rush, Knowbility
35 | - Brent Bakken, Pearson
36 | - **EOWG Staff Contact:**
37 | - [Shawn Lawton Henry](https://www.w3.org/People/shawn), W3C WAI
38 |
39 | For the recent updates:
40 | - **Project Coordinator:**
41 | - Shawn Lawton Henry
42 | - **Editor:**
43 | - Brian Elton
44 |
45 | ## Contributing Working Group Participants
46 | * Shawn Lawton Henry
47 | * Anna Belle Leiserson
48 | * Sharron Rush
49 | * Bim Egan
50 | * Laura Keen
51 | * [AG WG participants](https://www.w3.org/groups/wg/ag/participants)
52 | * [EOWG participants](https://www.w3.org/groups/wg/eowg/participants)
53 |
54 | ## Graphics, Photos, Example Text
55 |
56 | ### Graphics
57 |
58 | * [Phone designed by Tom Walsh from the Noun Project](http://thenounproject.com/term/phone/52971/)
59 | * [Fax designed by Vasily Ledovsky from the Noun Project](http://thenounproject.com/term/fax/8017/)
60 | * [Farm Fresh Web Icons](http://www.fatcow.com/free-icons)
61 |
62 | ### Photos
63 |
64 | * [Peacock image](https://en.wikipedia.org/wiki/File:Pavo_Real_Venezolano.jpg), by The Photographer [CC0 ], via Wikimedia Commons
65 | * [Burtons Creekside](https://secure.flickr.com/photos/makelessnoise/1423697879/in/set-72157602113996846/) by [Brian on Flickr](https://secure.flickr.com/photos/makelessnoise/)
66 |
67 | ### Example text
68 |
69 | * Peacock description from Wikipedia article [Indian peafowl](https://en.wikipedia.org/w/index.php?title=Indian_peafowl&oldid=647099660) as accessed on 16 February 2015.
70 |
--------------------------------------------------------------------------------
/content/carousels/animations.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Animations
3 |
4 | lang: en
5 | permalink: /tutorials/carousels/animations/
6 | ref: /tutorials/carousels/animations/
7 |
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/carousels/animations.md'
12 |
13 | resource:
14 | ref: /tutorials/carousels/
15 | navigation:
16 | previous: /tutorials/carousels/functionality/
17 | next: /tutorials/carousels/styling/
18 |
19 | wcag_success_criteria:
20 | - 2.2.2
21 |
22 | metafooter: true
23 | first_published: "May 2015"
24 | last_updated: 2019-11-27
25 | editors:
26 | - Eric Eggert: "https://www.w3.org/People/yatil/"
27 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
28 | update_editors:
29 | - Brian Elton
30 | contributing_participants:
31 | - see Acknowledgements
32 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
33 | ---
34 |
35 | Provide users with control over animations in the carousel. Pausing animation is essential for people who find movement distracting or who need more time to read.
36 |
37 | ## Add Play/Stop button
38 |
39 | Provide a button to allow users to stop and resume animation. The example below illustrates how such a button can be marked-up. The button label and its function changes, depending on whether the animation is currently running or not.
40 |
41 | {::nomarkdown}
42 | {% include box.html type="start" title="Code: While animation is running" class="example" %}
43 | {:/}
44 |
45 | ~~~html
46 | Stop Animation ■
47 | ~~~
48 |
49 | {::nomarkdown}
50 | {% include box.html type="end" %}
51 | {:/}
52 |
53 | {::nomarkdown}
54 | {% include box.html type="start" title="Code: While animation is stopped" class="example" %}
55 | {:/}
56 |
57 | ~~~html
58 | Start Animation ▶
59 | ~~~
60 |
61 | {::nomarkdown}
62 | {% include box.html type="end" %}
63 | {:/}
64 |
65 |
66 | {% include ednote.html note="The following paragraph was show in a side column before." %}A [working demo example](/tutorials/carousels/working-example/) for this code is available.
67 |
68 | {::nomarkdown}
69 | {% include box.html type="start" title="Note" class="simple notes" %}
70 | {:/}
71 |
72 | The JavaScript only replaces the value of the `` element and its attributes. Replacing the entire button would result in loss of keyboard focus.
73 |
74 | {::nomarkdown}
75 | {% include box.html type="end" %}
76 | {:/}
77 |
78 | ## Pause on mouse hover and keyboard focus
79 |
80 | Pause the carousel animation when the mouse pointer is hovering over the carousel or when it receives keyboard focus. Pausing on mouse hover is useful for people who need more time to read the content and makes it easier to click links in the carousel. Keyboard users do not lose their position when the carousel is paused.
81 |
82 | {::nomarkdown}
83 | {% include box.html type="start" title="Code: " class="example" %}
84 | {:/}
85 |
86 | ~~~js
87 | carousel.addEventListener('mouseenter', suspendAnimation);
88 | carousel.addEventListener('mouseleave', startAnimation);
89 |
90 | carousel.addEventListener('focusin',
91 | function(event) {
92 | if (!hasClass(event.target, 'slide')) {
93 | suspendAnimation();
94 | }
95 | }
96 | );
97 | carousel.addEventListener('focusout',
98 | function(event) {
99 | if (!hasClass(event.target, 'slide')) {
100 | startAnimation();
101 | }
102 | }
103 | );
104 | ~~~
105 |
106 | {::nomarkdown}
107 | {% include box.html type="end" %}
108 | {:/}
109 |
110 | {::nomarkdown}
111 | {% include box.html type="start" title="Note" class="simple notes" %}
112 | {:/}
113 |
114 | {% include ednote.html note="These are now supported everywhere." %}The [`focusin`](/tutorials/carousels/https://www.w3.org/TR/DOM-Level-3-Events/#event-type-focusIn) and [`focusout`](https://www.w3.org/TR/DOM-Level-3-Events/#event-type-focusout) events are defined in the [W3C Document Object Model (DOM) Level 3 Events Specification](https://www.w3.org/TR/DOM-Level-3-Events/) (Working Draft) and implemented in many browsers. Firefox needs [a short polyfill](full-code/) at the time of publication of this tutorial.
115 |
116 | {::nomarkdown}
117 | {% include box.html type="end" %}
118 | {:/}
119 |
120 | ## Hiding transitioning elements from assistive technologies
121 |
122 | During transitions, the current and next items are visible. This also means that those two items are available to assistive technologies, with the current item disappearing, which can be confusing to screen reader users.
123 |
124 | In the following example, the item that is being activated gets an `in-transition` class that makes it visible. The `aria-hidden` attribute is set to `true` to hide the item from assistive technologies. When the transition completes, the `aria-hidden` attribute is removed.
125 |
126 | {::nomarkdown}
127 | {% include box.html type="start" title="Code: JavaScript" class="example" %}
128 | {:/}
129 |
130 | ~~~js
131 | slides[new_next].className = 'next slide'
132 | + ((transition == 'next') ? ' in-transition' : '');
133 | slides[new_next].setAttribute('aria-hidden', 'true');
134 |
135 | slides[new_prev].className = 'prev slide'
136 | + ((transition == 'prev') ? ' in-transition' : '');
137 | slides[new_prev].setAttribute('aria-hidden', 'true');
138 |
139 | slides[new_current].className = 'current slide';
140 | slides[new_current].removeAttribute('aria-hidden');
141 | ~~~
142 |
143 | {::nomarkdown}
144 | {% include box.html type="end" %}
145 | {:/}
146 |
--------------------------------------------------------------------------------
/content/carousels/examples/focusinoutpolyfill.js:
--------------------------------------------------------------------------------
1 | // Source: https://gist.github.com/nuxodin/9250e56a3ce6c0446efa
2 |
3 | /* focusin/out event polyfill (firefox) */
4 | !function(){
5 | var w = window,
6 | d = w.document;
7 |
8 | if( w.onfocusin === undefined ){
9 | d.addEventListener('focus' ,addPolyfill ,true);
10 | d.addEventListener('blur' ,addPolyfill ,true);
11 | d.addEventListener('focusin' ,removePolyfill ,true);
12 | d.addEventListener('focusout' ,removePolyfill ,true);
13 | }
14 | function addPolyfill(e){
15 | var type = e.type === 'focus' ? 'focusin' : 'focusout';
16 | var event = new CustomEvent(type, { bubbles:true, cancelable:false });
17 | event.c1Generated = true;
18 | e.target.dispatchEvent( event );
19 | }
20 | function removePolyfill(e){
21 | if(!e.c1Generated){ // focus after focusin, so chrome will the first time trigger tow times focusin
22 | d.removeEventListener('focus' ,addPolyfill ,true);
23 | d.removeEventListener('blur' ,addPolyfill ,true);
24 | d.removeEventListener('focusin' ,removePolyfill ,true);
25 | d.removeEventListener('focusout' ,removePolyfill ,true);
26 | }
27 | setTimeout(function(){
28 | d.removeEventListener('focusin' ,removePolyfill ,true);
29 | d.removeEventListener('focusout' ,removePolyfill ,true);
30 | });
31 | }
32 | }();
33 |
--------------------------------------------------------------------------------
/content/carousels/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Carousels Tutorial
3 | lang: en
4 |
5 | permalink: /tutorials/carousels/
6 | ref: /tutorials/carousels/
7 |
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/carousels/index.md'
12 |
13 | resource:
14 | ref: /tutorials/
15 | navigation:
16 | next: /tutorials/carousels/structure/
17 |
18 | wcag_success_criteria:
19 | - 1.3.1
20 | - 2.1.1
21 | - 2.2.2
22 | - 4.1.2
23 |
24 | metafooter: true
25 | first_published: "May 2015"
26 | last_updated: 2017-04-13
27 | editors:
28 | - Eric Eggert: "https://www.w3.org/People/yatil/"
29 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
30 | update_editors:
31 | - Brian Elton
32 | contributing_participants:
33 | - see Acknowledgements
34 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
35 | ---
36 |
37 | Implement an accessible carousel widget by providing a robust structure and user control:
38 |
39 | * **[Structure](/tutorials/carousels/structure/):** Use semantic structure for the carousel to support proper function of assistive technology.
40 | * **[Functionality](/tutorials/carousels/functionality/):** Add functionality to display and announce carousel items.
41 | * **[Animations](/tutorials/carousels/animations/):** Add a transition animation between items and ensure users can stop and resume it.
42 | * **[Styling](/tutorials/carousels/styling/):** Style the carousel to make sure it’s usable and readable by everyone.
43 |
44 | See also the [complete working example](/tutorials/carousels/working-example/) and [full code](/tutorials/carousels/full-code/) of the example carousel.
45 |
46 | ## What are carousels?
47 |
48 | Carousels show a collection of items one at a time. They are also known as “slideshows” and “sliders”. Typical uses of carousels include scrolling news headlines, featured articles on home pages, and image galleries.
49 |
50 | ## What makes a carousel accessible?
51 |
52 | - Users must be able to pause carousel movement because it can be too fast or distracting, making text hard to read.
53 | - All functionality, including navigating between carousel items, must be operable by keyboard.
54 | - Changes to carousel items must be communicated to all users, including screen reader users.
55 | - The keyboard position (“focus”) is managed in a reasonable and comprehensible fashion.
56 |
57 | **Note:** Carousels are disputed from a usability perspective because their content can be hard to discover. Ensuring accessibility can also improve usability.
58 |
59 | ## Why is this important?
60 |
61 | Typically, carousels are prominently located and are used to provide navigation or show page content. Accessible carousels are essential for many website users including:
62 |
63 | - **People using keyboard navigation and voice input software** can navigate between individual items.
64 | - **People using screen readers** will understand which item is currently shown and how to navigate between items.
65 | - **People who are distracted by movement** can pause animations.
66 | - **People who need more time to read** can pause animations, providing them with sufficient time to read and understand carousel content.
67 |
--------------------------------------------------------------------------------
/content/carousels/structure.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Carousel Structure
3 | lang: en
4 | permalink: /tutorials/carousels/structure/
5 | ref: /tutorials/carousels/structure/
6 |
7 | github:
8 | branch: 'master-2.0'
9 | repository: w3c/wai-tutorials
10 | path: 'content/carousels/structure.md'
11 |
12 | resource:
13 | ref: /tutorials/carousels/
14 | navigation:
15 | previous: /tutorials/carousels/
16 | next: /tutorials/carousels/functionality/
17 |
18 | wcag_success_criteria:
19 | - 1.3.1
20 | - 2.4.6
21 | wcag_techniques:
22 | - G130
23 | - H42
24 | - H48
25 |
26 | metafooter: true
27 | first_published: "May 2015"
28 | last_updated: 2017-04-13
29 | editors:
30 | - Eric Eggert: "https://www.w3.org/People/yatil/"
31 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
32 | update_editors:
33 | - Brian Elton
34 | contributing_participants:
35 | - see Acknowledgements
36 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
37 | ---
38 |
39 | Structural markup ensures that the content of a carousel can be used in a variety of situations. For example, a carousel with proper markup could be presented as a list of articles on a mobile device.
40 |
41 | ## General Structure
42 |
43 | As a collection of content items, carousels are typically best represented as unordered lists, using `` and ``. Depending on the context, other elements can also be used.
44 |
45 | Every carousel should be enclosed in a labeled region, to allow users to find the carousel easily. In the following example, a `` element is used to define the region and `aria-labelledby` defines the heading that contains the label.
46 |
47 | {% include ednote.html note="The following paragraph was show in a side column before." %} See the Page Structure Tutorial for more information on [regions](/tutorials/page-structure/regions/) and [labels](/tutorials/page-structure/labels/).
48 |
49 |
50 | {::nomarkdown}
51 | {% include box.html type="start" title="Code" class="example" %}
52 | {:/}
53 |
54 | ~~~html
55 |
56 | Recent news
57 |
58 | …
59 | …
60 | …
61 | …
62 |
63 |
64 | ~~~
65 |
66 | {::nomarkdown}
67 | {% include box.html type="end" %}
68 | {:/}
69 |
70 | {% include ednote.html note="The following paragraph was show in a side column before." %} A [working demo example](/tutorials/carousels/working-example/) for this code is available.
71 |
72 | ## Carousel items
73 |
74 | Carousels are often used as a gallery to display a series of images. However, more complex content, such as teasers, articles, or entire sections of web pages can also be shown inside carousels. In all cases, use appropriate markup to ensure that the structure and meaning of the content are conveyed clearly. Such markup may include headings, sections, lists, articles, and other elements as needed.
75 |
76 | This first example shows a carousel item with images as content:
77 |
78 | {::nomarkdown}
79 | {% include box.html type="start" title="Code: Example 1" class="example" %}
80 | {:/}
81 |
82 | ~~~html
83 | …
84 |
85 |
86 |
87 | …
88 | ~~~
89 |
90 | {::nomarkdown}
91 | {% include box.html type="end" %}
92 | {:/}
93 |
94 | This example of an article that includes a heading and a paragraph shows how more complex content can be used.
95 |
96 | {::nomarkdown}
97 | {% include box.html type="start" title="Code: Example 2" class="example" %}
98 | {:/}
99 |
100 | ~~~html
101 | …
102 |
103 |
104 | Space Teddy production reaches all-time high
105 | Teddies in Space Inc. has released outstanding numbers for the last solar year. The production of Space Teddies increased by 17%. The new version, scheduled to be released in a few months, will likely be the biggest Space Teddy release ever.
106 | …
107 |
108 |
109 | …
110 | ~~~
111 |
112 | {::nomarkdown}
113 | {% include box.html type="end" %}
114 | {:/}
115 |
--------------------------------------------------------------------------------
/content/carousels/styling.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Styling
3 |
4 | lang: en
5 | permalink: /tutorials/carousels/styling/
6 | ref: /tutorials/carousels/styling/
7 |
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/carousels/styling.md'
12 |
13 | resource:
14 | ref: /tutorials/carousels/
15 | navigation:
16 | previous: /tutorials/carousels/animations/
17 | next: /tutorials/carousels/working-example/
18 |
19 | wcag_success_criteria:
20 | - 1.4.1
21 | - 1.4.3
22 | - 2.4.7
23 | - 2.5.5
24 |
25 | metafooter: true
26 | first_published: "May 2015"
27 | last_updated: 2024-05-13
28 | editors:
29 | - Eric Eggert: "https://www.w3.org/People/yatil/"
30 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
31 | update_editors:
32 | - Brian Elton
33 | contributing_participants:
34 | - see Acknowledgements
35 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
36 | ---
37 |
38 | ## Button Size
39 |
40 | Use appropriately sized buttons and links, and provide whitespace around them, to allow people with reduced dexterity to use the carousel more easily. This also benefits people using touch screens, such as on mobile devices. Buttons and links that are not inline in a block of text should be at least 44 × 44 CSS pixels.
41 |
42 | ## Contrast
43 |
44 | {:.left} Ensure sufficient contrast between the foreground and the background of text, links, and buttons. This can be a challenge when text or buttons are positioned on top of images. In that case, a (semi-) opaque background color can help to maintain the contrast regardless of the image used.
45 |
46 |
47 | {% include ednote.html note="The following paragraph was show in a side column before." %}For more information on contrast requirements, see [Provide sufficient contrast between foreground and background](/tips/designing/#provide-sufficient-contrast-between-foreground-and-background).
48 |
49 | ## Indicate Button Status
50 |
51 | Since the navigation buttons added to the carousel are typically small, it is important to indicate their status both in color and shape (in addition to proper naming and labeling). This makes it easier for people to differentiate the buttons and their current status.
52 |
53 | In the following example, a filled square is used for buttons associated with items currently not shown. The button for the item shown has rounded corners and inverted colors. When users hover over these buttons using a mouse or focus them using a keyboard, their border is dotted.
54 |
55 | {::nomarkdown}
56 | {% include box.html type="start" title="Example" class="example" %}
57 | {:/}
58 |
59 |
89 |
90 |
91 |
92 |
93 | News 1
94 | (Current Slide)
95 |
96 |
97 |
98 |
99 | News 2
100 |
101 |
102 |
103 |
104 | News 3
105 |
106 |
107 |
108 |
109 |
114 |
115 | {::nomarkdown}
116 | {% include box.html type="end" %}
117 | {:/}
118 |
119 | {% include ednote.html note="The following paragraph was show in a side column before." %}A [working demo example](/tutorials/carousels/working-example/) for this code is available.
120 |
121 | ## For smaller screens/small viewports
122 | Ensure all text is readable and not cut off or unnecessarily truncated. Make sure that [navigation buttons](/tutorials/carousels/functionality/#add-navigation-buttons) to control the slides are available, since some people cannot use swipe gestures.
123 |
124 |
--------------------------------------------------------------------------------
/content/changelog.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Changelog"
3 | permalink: /tutorials/changelog/
4 | ref: /tutorials/changelog/
5 | lang: en
6 | description:
7 | image: /content-images/wai-tutorials/images/social.png
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/changelog.md'
12 |
13 | resource:
14 | ref: /tutorials/
15 |
16 | footer: >
17 | Editors: Eric Eggert, Shadi Abou-Zahra. Update Editor: Brian Elton. Contributors: Shawn Lawton Henry, Anna Belle Leiserson, Sharron Rush, Bim Egan, AG WG participants , EOWG participants .
18 | Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme.
19 | ---
20 |
21 | {::nomarkdown}
22 | {% include box.html type="start" title="Changelog listing note" %}
23 | {:/}
24 |
25 | This changelog lists substantive content edits. It does **not** list typo fixes and other minor edits.
26 |
27 | {::nomarkdown}
28 | {% include box.html type="end" %}
29 | {:/}
30 | ## May 2024
31 | In [Forms tutorial](/tutorials/forms/)
32 | * Fixing a broken link in [Form Instructions](/tutorials/forms/instructions/#placeholder-text)
33 | * [GitHub PR #735](https://github.com/w3c/wai-tutorials/pull/735)
34 | * Fixing a color contrast issue in [Multi-page Forms](/tutorials/forms/multi-page/#using-the-html5-progress-element)
35 | * [GitHub PR #732](https://github.com/w3c/wai-tutorials/pull/732)
36 |
37 | In [Tables tutorial](/tutorials/tables/)
38 | * Fixing a table header issue in [Tables with Multi-Level Headers](/tutorials/tables/multi-level/#table-with-multiple-column-headers-in-each-column)
39 | * [GitHub PR #726](https://github.com/w3c/wai-tutorials/pull/726)
40 |
41 | In [Images tutorial](/tutorials/images/)
42 | * Updating link text in [An alt
Decision Tree](/tutorials/images/decision-tree/)
43 | * [GitHub PR #774](https://github.com/w3c/wai-tutorials/pull/774)
44 |
45 | Added notes about responsive design/smaller screen considerations to:
46 | * [Page Structure > Page Regions](/tutorials/page-structure/regions/)
47 | * [Menus > Structure](/tutorials/menus/structure/)
48 | * [Forms > Labeling Controls](/tutorials/forms/labels/)
49 | * [Carousels > Styling](/tutorials/carousels/styling/)
50 |
51 | ## February 2023
52 |
53 | * In Tables main page, corrected WCAG links under [Related WCAG resources](https://www.w3.org/WAI/tutorials/tables/#related)
54 |
55 | ## 2022
56 | We published several bug fixes and typo fixes throughout 2022
57 |
58 | ## August 2018
59 |
60 | Fixing some issues:
61 |
62 | * Minor Editorial fixes: [#554](https://github.com/w3c/wai-tutorials/pull/554), [#555](https://github.com/w3c/wai-tutorials/pull/555)
63 | * [Clarify table headers/id example (#533)](https://github.com/w3c/wai-tutorials/pull/533)
64 | * [Changes to Flyout Menus Approach 2 (#534)](https://github.com/w3c/wai-tutorials/pull/534)
65 | * [Image Maps: Fix full code example (#536)](https://github.com/w3c/wai-tutorials/pull/536)
66 | * [Fix issue with flyout menu approach one (#562)](https://github.com/w3c/wai-tutorials/pull/562)
67 | * [Fix issues with application menu (#563)](https://github.com/w3c/wai-tutorials/pull/563)
68 |
69 | ## May 2017
70 |
71 | ### Overall changes:
72 |
73 | * Introducing cross-links to other documents
74 | * Making demos easier to discover
75 | * Using a new, easier to read font
76 |
77 | ### New Publications: Page Structure, Menus Tutorial, and Carousels Tutorial
78 |
79 | * Substantive clarification and simplification of the language from the previously published draft
80 | * Page Structure:
81 | * Vastly expanded page structure tutorial
82 | * Rename “Page Sections” to “Page Regions” to clarify terminology, added example images
83 | * Add a “Labeling Regions” page
84 | * Clarify the headings page, including a better description of ranks and example images for different uses of headings.
85 | * Move “articles” and “sections” from the “Page Sections” page to the “Content Structure” page
86 | * Clarify and expand on the ordered, unordered, and description lists
87 | * Remove “Styling” and “In-page Navigation” pages to focus the tutorial
88 | * Add an example that shows all techniques used
89 | * Menus:
90 | * Clearer language and structure on the structure page
91 | * Complete overhaul of the styling page to focus on menu identification and interaction
92 | * Clarify structure of the fly-out menus page
93 | * Application menus: Move code and example to separate page, clarified ARIA information
94 | * Remove the multiple ways page to focus the tutorial
95 | * Carousels:
96 | * Moved styling considerations to one central new styling page
97 | * Updated structure of the functionality page, including new content for announcing the current carousel item and focus management
98 | * Updated structure and more focus on the animations page
99 | * Moved the working example and the full code examples to their own pages
100 |
101 | ### Minor Updates: Images, Forms, and Tables Tutorial
102 |
103 | * Several minor editorial changes
104 | * Images Tutorial: [Add new description to the decision tree (Show differences)](https://services.w3.org/htmldiff?doc1=https%3A%2F%2Frawgit.com%2Fw3c%2Fwai-tutorials%2Frendered-2015-03%2Fimages%2Fdecision-tree%2F&doc2=https%3A%2F%2Frawgit.com%2Fw3c%2Fwai-tutorials%2Fbf1f9f95e2ebeec2b3f25ca1fa336dfc6caf166f%2Fimages%2Fdecision-tree%2F)
105 | * Forms Tutorial: [Use color #767676 instead of #777 for placeholders (Show differences)](https://services.w3.org/htmldiff?doc1=https%3A%2F%2Frawgit.com%2Fw3c%2Fwai-tutorials%2Frendered-2015-03%2Fforms%2Finstructions%2F&doc2=https%3A%2F%2Frawgit.com%2Fw3c%2Fwai-tutorials%2Fbf1f9f95e2ebeec2b3f25ca1fa336dfc6caf166f%2Fforms%2Finstructions%2F)
106 | * Forms Tutorial: [Emphasize explicit labels, add aria-labelledby example to labels page (Show differences)](https://services.w3.org/htmldiff?doc1=https%3A%2F%2Frawgit.com%2Fw3c%2Fwai-tutorials%2Frendered-2015-03%2Fforms%2Flabels%2F&doc2=https%3A%2F%2Frawgit.com%2Fw3c%2Fwai-tutorials%2Fbf1f9f95e2ebeec2b3f25ca1fa336dfc6caf166f%2Fforms%2Flabels%2F)
107 | * Forms Tutorial: [Add information about focus management when an error occurs (Show differences)](https://services.w3.org/htmldiff?doc1=https%3A%2F%2Frawgit.com%2Fw3c%2Fwai-tutorials%2Frendered-2015-03%2Fforms%2Fnotifications%2F&doc2=https%3A%2F%2Frawgit.com%2Fw3c%2Fwai-tutorials%2Fbf1f9f95e2ebeec2b3f25ca1fa336dfc6caf166f%2Fforms%2Fnotifications%2F)
108 |
109 | ## March 2015
110 |
111 | * Updates
112 | * Images Tutorial
113 | * Forms Tutorial
114 | * Tables Tutorial
115 | * Draft Publication
116 | * Page Structure Tutorial
117 | * Menus Tutorial
118 | * Carousels Tutorial
119 |
120 | ## September 2014
121 |
122 | * First Publication:
123 | * Images Tutorial
124 | * Forms Tutorial
125 | * Tables Tutorial
126 |
--------------------------------------------------------------------------------
/content/forms/examples/password.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Complete Password Example
3 | lang: en
4 | permalink: /tutorials/forms/examples/password/
5 | ref: /tutorials/forms/examples/password/
6 |
7 | github:
8 | branch: 'master-2.0'
9 | repository: w3c/wai-tutorials
10 | path: 'content/forms/examples/password.md'
11 |
12 | resource_title: Forms Tutorial
13 |
14 | resource:
15 | ref: /tutorials/forms/notifications/
16 | ---
17 |
18 | **No data is sent using the following example input field. The password is shown in plain text for demonstration purposes.**
19 |
20 | {::nomarkdown}
21 | {% include box.html type="start" title="Example" class="example" %}
22 | {:/}
23 |
24 |
30 |
31 |
47 |
48 |
77 |
78 | {::nomarkdown}
79 | {% include box.html type="end" %}
80 | {:/}
81 | {::nomarkdown}
82 | {% include box.html type="start" title="Code: HTML" class="example" %}
83 | {:/}
84 |
85 | ~~~ html
86 | Password:
87 |
88 |
89 |
90 | ~~~
91 |
92 | {::nomarkdown}
93 | {% include box.html type="end" %}
94 | {:/}
95 |
96 | {::nomarkdown}
97 | {% include box.html type="start" title="Code: 'CSS" class="example" %}
98 | {:/}
99 |
100 | ~~~ css
101 | #passwordmeter {
102 | display:inline-block;
103 | width:125px;
104 | height: 20px;
105 | border: 1px solid #666;
106 | vertical-align:middle;
107 | }
108 | #passwordmeter span {
109 | display:inline-block;
110 | height:1em;
111 | background-color: gray;
112 | width:25px;
113 | height: 20px;
114 | }
115 | ~~~
116 |
117 | {::nomarkdown}
118 | {% include box.html type="end" %}
119 | {:/}
120 |
121 | {::nomarkdown}
122 | {% include box.html type="start" title="Code: 'JavaScript" class="example" %}
123 | {:/}
124 |
125 | ~~~ js
126 | document.getElementById('password').addEventListener('keyup',
127 | function(){
128 | // (1) Select the password meter and message elements.
129 | var meter = document.querySelector('#passwordmeter span');
130 | var msg = document.getElementById('passwordmessage');
131 |
132 | // (2) Calculate the strength of the password.
133 | var pw = get_pw_strength(this.value);
134 |
135 | // (3) Set the with of the password meter to a multiple of the score.
136 | meter.style.width = (pw.score+1) * 25 + 'px';
137 |
138 | /* (4) Set the color of the meter to
139 | a) red if the score < 3
140 | b) yellow if the score = 3
141 | c) green if the score = 4
142 |
143 | (5) Change the text of the password message element accordingly. */
144 | if (pw.score == 0) {
145 | meter.style.backgroundColor = 'red';
146 | msg.innerHTML = 'Really Weak Password';
147 | } else if (pw.score < 3) {
148 | meter.style.backgroundColor = 'red';
149 | msg.innerHTML = 'Weak Password (cracked in ' + pw.crack_time_display + ')';
150 | } else if (pw.score == 3) {
151 | meter.style.backgroundColor = 'yellow';
152 | msg.innerHTML = 'Good Password (cracked in ' + pw.crack_time_display + ')';
153 | } else {
154 | meter.style.backgroundColor = 'green';
155 | msg.innerHTML = 'Strong Password (cracked in ' + pw.crack_time_display + ')';
156 | }
157 |
158 | /* (6) If the input is empty, there is no text output
159 | and the color of the meter is set to gray. */
160 | if (this.value == "") {
161 | meter.style.backgroundColor = 'gray';
162 | msg.innerHTML = ' ';
163 | }
164 | });
165 | ~~~
166 |
167 | {::nomarkdown}
168 | {% include box.html type="end" %}
169 | {:/}
170 |
--------------------------------------------------------------------------------
/content/forms/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Forms Tutorial"
3 | permalink: /tutorials/forms/
4 | ref: /tutorials/forms/
5 | lang: en
6 |
7 | description:
8 | image: /content-images/wai-tutorials/forms/social.png
9 | github:
10 | branch: 'master-2.0'
11 | repository: w3c/wai-tutorials
12 | path: 'content/forms/index.md'
13 |
14 | resource_title: Forms Tutorial
15 |
16 | resource:
17 | ref: /tutorials/
18 | navigation:
19 | next: /tutorials/forms/labels/
20 |
21 | wcag_success_criteria:
22 | - 1.3.1
23 | - 2.4.6
24 | - 3.3.2
25 | - 4.1.2
26 |
27 | metafooter: true
28 | first_published: "September 2014"
29 | last_updated: 2019-07-27
30 | editors:
31 | - Eric Eggert: "https://www.w3.org/People/yatil/"
32 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
33 | update_editors:
34 | - Brian Elton
35 | contributing_participants:
36 | - see Acknowledgements
37 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
38 |
39 | changelog: /tutorials/changelog/
40 | acknowledgements: /tutorials/acknowledgements/
41 |
42 | ---
43 |
44 | Forms are commonly used to provide user interaction on websites and in web applications. For example, login, registering, commenting, and purchasing. This tutorial shows you how to create accessible forms. The same concepts apply to all forms, whether they are processed client or server-side.
45 |
46 | Aside from technical considerations, users usually prefer simple and short forms. Only ask users to enter what is required to complete the transaction or process; if irrelevant or excessive data is requested, users are more likely to abandon the form.
47 |
48 | - **[Labeling Controls](/tutorials/forms/labels/):** Use the `` element, and, in specific cases, other mechanisms (e.g. WAI-ARIA, `title` attribute etc.), to identify each form control.
49 |
50 | - **[Grouping Controls](/tutorials/forms/grouping/):** Use the `` and `` elements to group and associate related form controls.
51 |
52 | - **[Form Instructions](/tutorials/forms/instructions/):** Provide instructions to help users understand how to complete the form and individual form controls.
53 |
54 | - **[Validating Input](/tutorials/forms/validation/):** Validate input provided by the user and provide options to undo changes and confirm data entry.
55 |
56 | - **[User Notifications](/tutorials/forms/notifications/):** Notify users about successful task completion, any errors, and provide instructions to help them correct mistakes.
57 |
58 | - **[Multi-Page Forms](/tutorials/forms/multi-page/):** Divide long forms into multiple smaller forms that constitute a series of logical steps or stages and inform users about their progress.
59 |
60 | - **[Custom Controls](/tutorials/forms/custom-controls/):** Use stylized form elements and other progressive enhancement techniques to provide custom controls.
61 |
62 | ## A note on time limits
63 |
64 | If possible, forms should not be subject to a time limit to allow users to complete the form at their pace. If a time limit needs to be in place, for example, for security reasons, the user should have the option to turn it off or extend it. This restriction does not apply if the time limit is due to a live event, such as an auction or a game, or if the time to complete the form is essential for a valid submission.
65 |
66 | ## Why is this important?
67 |
68 | Forms can be visually and cognitively complex and challenging to use. Accessible forms are easier to use for everyone, including people with disabilities.
69 |
70 | - **People with cognitive disabilities** can better understand the form and how to complete it, as making forms accessible improves the layout structure, instructions, and feedback.
71 |
72 | - **People using speech input** can use the labels via voice commands to activate controls and move the focus to the fields that they have to complete.
73 |
74 | - **People with limited dexterity** benefit from large clickable areas that include the labels, especially for smaller controls, such as radio buttons and checkboxes.
75 |
76 | - **People using screen readers** can identify and understand form controls more easily because they are associated with labels, field sets, and other structural elements.
77 |
--------------------------------------------------------------------------------
/content/images/decision-tree.de.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Ein alt-Entscheidungsbaum"
3 | title_html: "Ein alt
-Entscheidungsbaum"
4 | lang: de
5 | last_updated: 2024-04-08
6 |
7 | translators:
8 | - name: "Alexej Rotar"
9 | contributors:
10 | - name: "Jens Oliver Meiert"
11 | link: "https://meiert.com/de/biography/"
12 | - name: "Doro Hinrichs"
13 |
14 | github:
15 | branch: 'master-2.0'
16 | repository: w3c/wai-tutorials
17 | path: 'content/images/decision-tree.de.md'
18 |
19 | resource:
20 | ref: /tutorials/images/
21 | navigation:
22 | previous: /tutorials/images/imagemap/
23 | next: /tutorials/images/tips/
24 |
25 | permalink: /tutorials/images/decision-tree/de
26 | ref: /tutorials/images/decision-tree/
27 |
28 | metafooter: true
29 | editors:
30 | - Eric Eggert: "https://www.w3.org/People/yatil/"
31 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
32 | update_editors:
33 | - Brian Elton
34 | contributing_participants:
35 | - siehe Danksagung
36 | support: Entwickelt von der Arbeitsgruppe für Bildung und Öffentlichkeitsarbeit (EOWG ). Entwickelt mit der Unterstützung vom WAI-ACT-Projekt , kofinanziert vom IST -Programm der Europäischen Kommission .
37 |
38 | ---
39 |
40 | {::nomarkdown}
41 | {% include box.html type="start" h="2" title="Überblick" class="full" %}
42 | {:/}
43 |
44 | Dieser Entscheidungsbaum beschreibt, wie man das `alt`-Attribut des ` `-Elements in verschiedenen Situationen verwendet. Für manche Arten von Bildern gibt es Alternativen, etwa CSS-Hintergrundbilder für dekorative Bilder oder Webfonts anstelle von Bildern von Text.
45 |
46 | {::nomarkdown}
47 | {% include box.html type="end" %}
48 | {:/}
49 |
50 | - **Enthält das Bild Text?**
51 | - {:.yes} **Ja:**
52 | - **… und der Text ist auch als *richtiger* Text in der Nähe vorhanden.**
53 | _Nutzen Sie ein leeres `alt`-Attribut. Siehe [Dekorative Bilder](/tutorials/images/decorative/)._
54 | - **… und der Text wird nur für visuelle Effekte dargestellt.**
55 | _Nutzen Sie ein leeres `alt`-Attribut. Siehe [Dekorative Bilder](/tutorials/images/decorative/)._
56 | - **… und der Text hat eine bestimmte Funktion, beispielsweise handelt es sich um ein Icon.**
57 | _Nutzen Sie das `alt`-Attribut, um die Funktion des Bildes zu kommunizieren. Siehe [Funktionale Bilder](/tutorials/images/functional/)._
58 | - **… und der Text im Bild kommt sonst nirgends vor.** _Nutzen Sie das `alt`-Attribut, um den Text aus dem Bild zu wiederholen. Siehe [Bilder von Text](/tutorials/images/textual/#styled-text-decorative-effect)._
59 | - {:.no} **Nein:**
60 | - Fahren Sie fort.
61 | - **Wird das Bild in einem Link oder Button verwendet und wäre es schwer oder unmöglich zu verstehen, was der Link oder Button tut, wenn das Bild fehlen würde?**
62 | - {:.yes} **Ja:**
63 | - _Nutzen Sie das `alt`-Attribut, um das Ziel des Links oder die Aktion zu kommunizieren. Siehe [Funktionale Bilder](/tutorials/images/functional/)._
64 | - {:.no} **Nein:**
65 | - Fahren Sie fort.
66 | - **Trägt das Bild zur Bedeutung der aktuellen Seite oder des aktuellen Zusammenhangs bei?**
67 | - {:.yes} **Ja:**
68 | - **… und es ist eine einfache Grafik oder ein Foto.**
69 | _Nutzen Sie eine kurze Beschreibung des Bildes im `alt`-Attribut, die diese Bedeutung vermittelt. Siehe [Informative Bilder](/tutorials/images/informative/)._
70 | - **… und es ist ein Graph oder stellt komplexe Informationen dar.**
71 | _Vermitteln Sie die Information aus dem Bild auch an anderer Stelle auf der Seite. Siehe [Komplexe Bilder](/tutorials/images/complex/)._
72 | - **… und es zeigt Inhalt, der in *richtigem* Text in der Nähe enthalten ist.**
73 | _Nutzen Sie ein leeres `alt`-Attribut. Siehe (redundante) [Funktionale Bilder](/tutorials/images/functional/#logo-image-within-link-text)._
74 | - {:.no} **Nein:**
75 | - Fahren Sie fort.
76 | - **Ist das Bild rein dekorativ oder nicht für Nutzende gedacht?**
77 | - {:.yes} **Ja:**
78 | - _Nutzen Sie ein leeres `alt`-Attribut. Siehe [Dekorative Bilder](/tutorials/images/decorative/)._
79 | - {:.no} **Nein:**
80 | - Fahren Sie fort.
81 | - **Ist der Zweck des Bildes nicht in der obigen Auflistung enthalten oder ist es unklar, welcher `alt`-Text zu verwenden ist?**
82 | - {:.yes} Dieser Entscheidungsbaum deckt **nicht alle** Fälle ab. Für detailierte Informationen über die Bereitstellung von Textalternativen, beachten Sie die [Seite zu Bildkonzepten](/tutorials/images/).
83 | {:.decision-tree}
84 |
--------------------------------------------------------------------------------
/content/images/decision-tree.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | # Translation instructions are after the "#" character in this first section. They are comments that do not show up in the web page. You do not need to translate the instructions after "#".
3 | # In this first section, do not translate the words before a colon. For example, do not translate "title:". Do translate the text after "title:".
4 |
5 | title: "Un arbre décisionnel pour l'attribut alt"
6 | title_html: "Un arbre décisionnel pour l'attribut alt
"
7 | lang: fr # Change "en" to the translated-language shortcode
8 | last_updated: 2024-01-15 # Put the date of this translation YYYY-MM-DD (with month in the middle)
9 |
10 | translators:
11 | - name: Rémi Bétin
12 |
13 | github:
14 | branch: 'master-2.0'
15 | repository: w3c/wai-tutorials
16 | path: 'content/images/decision-tree.fr.md' # Add the language shortcode to the middle of the filename, for example: content/index.fr.md
17 |
18 | resource:
19 | ref: /tutorials/images/ # Do not change this
20 |
21 | navigation:
22 | previous: /tutorials/images/imagemap/ # Do not change this
23 | next: /tutorials/images/tips/ # Do not change this
24 |
25 | permalink: /tutorials/images/decision-tree/fr # Add the language shortcode to the end, with no slash at end, for example: /link/to/page/fr
26 | ref: /tutorials/images/decision-tree/ # Do not change this
27 |
28 | # In the footer below:
29 | # Translate the Working Group name. Leave the Working Group acronym in English.
30 | metafooter: true
31 | editors:
32 | - Eric Eggert: "https://www.w3.org/People/yatil/"
33 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
34 | update_editors:
35 | - Brian Elton
36 | contributing_participants:
37 | - Voir Remerciements
38 | support: Développé avec le groupe de travail Education et Promotion (EOWG ). Développé avec le soutien du projet WAI-ACT , co-financé par le programme IST de la Commission européenne .
39 | ---
40 |
41 | {::nomarkdown}
42 | {% include box.html type="start" h="2" title="Vue d'ensemble" class="full" %}
43 | {:/}
44 |
45 | Cet arbre décisionnel décrit comment utiliser l'attribut `alt` de l'élément ` ` dans diverses situations. Pour certains types d'images, des approches alternatives existent, comme utiliser des images CSS d'arrière-plan pour les images décoratives, ou des polices web plutôt que des images de texte.
46 |
47 | {::nomarkdown}
48 | {% include box.html type="end" %}
49 | {:/}
50 |
51 | - **Est-ce que l'image contient du texte ?**
52 | - {:.yes} **Oui :**
53 | - **… et le texte est aussi présent à proximité, comme du texte *réel*.**
54 | _Utilisez un attribut `alt` vide. Voir [Images décoratives](/tutorials/images/decorative/)._
55 | - **… et le texte est seulement présenté pour des effets visuels.**
56 | _Utilisez un attribut `alt` vide. Voir [Images décoratives](/tutorials/images/decorative/)._
57 | - **… et le texte a une fonction spécifique : il s'agit d'une icône par exemple.**
58 | _Utilisez l'attribut `alt` pour communiquer la fonction de l'image. Voir [Images fonctionnelles](/tutorials/images/functional/)._
59 | - **… et le texte dans l'image n'est pas présent ailleurs.**
60 | _Utilisez l'attribut `alt` pour inclure le texte de l'image. Voir [Images de texte](/tutorials/images/textual/#styled-text-decorative-effect)._
61 | - {:.no} **Non :**
62 | - Continuez.
63 | - **Est-ce que l'image est utilisée dans un lien ou un bouton, et serait-il difficile voire impossible de comprendre ce que le lien ou le bouton fait, si l'image n'était pas présente ?**
64 | - {:.yes} **Oui:**
65 | - _Utilisez l'attribut `alt` pour communiquer la destination du lien ou de l'action réalisée. Voir [Images fonctionnelles](/tutorials/images/functional/)._
66 | - {:.no} **Non :**
67 | - Continuez.
68 | - **Est-ce que l'image contribue à comprendre la signification de la page courante ou du contexte ?**
69 | - {:.yes} **Oui :**
70 | - **… et c'est une simple illustration ou photographie.**
71 | _Utilisez une description brève de l'image, d'une manière qui transmette cette signification dans l'attribut `alt`. Voir [Images informatives](/tutorials/images/informative/)._
72 | - **… et c'est un graphique ou une information complexe.**
73 | _Incluez l'information contenue dans l'image ailleurs sur la page. Voir [Images complexes](/tutorials/images/complex/)._
74 | - **… et elle présente du contenu qui est redondant avec le texte *réel* à proximité.**
75 | _Utilisez un attribut `alt` vide. Voir [Images fonctionnelles](/tutorials/images/functional/#logo-image-within-link-text) (redondantes)._
76 | - {:.no} **Non :**
77 | - Continuez.
78 | - **Est-ce que l'image est purement décorative, ou pas destinée aux utilisateurs ?**
79 | - {:.yes} **Oui :**
80 | - _Utilisez un attribut `alt` vide. Voir [Images décoratives](/tutorials/images/decorative/)._
81 | - {:.no} **Non :**
82 | - Continuez.
83 | - **L'usage de l'image n'est pas listé ci-dessus ; ou le texte `alt` à fournir n'est pas clair ?**
84 | - {:.yes} Cet arbre décisionnel ne couvre **pas** tous les cas. Pour des informations détaillées sur les textes alternatifs à fournir, référez-vous à [la page Concepts - Images](/tutorials/images/).
85 | {:.decision-tree}
86 |
--------------------------------------------------------------------------------
/content/images/decision-tree.id.md:
--------------------------------------------------------------------------------
1 | ---
2 | # Translation instructions are after the "#" character in this first section. They are comments that do not show up in the web page. You do not need to translate the instructions after "#".
3 | # In this first section, do not translate the words before a colon. For example, do not translate "title:". Do translate the text after "title:".
4 |
5 | title: "Pohon Keputusan Penggunaan alt"
6 | title_html: "Pohon Keputusan Penggunaan alt
"
7 | lang: id # Change "en" to the translated-language shortcode
8 | last_updated: 2024-03-18 # Put the date of this translation YYYY-MM-DD (with month in the middle)
9 |
10 | translators: # remove from the beginning of this line and the lines below: "# " (the hash sign and the space)
11 | - name: "Fri Rasyidi" # Add one -name: line for every translator
12 | # - name: "Jan Doe" # Replace Jan Doe with translator name
13 | # - name: "Jan Doe" # Replace Jan Doe with name, or delete this line if not multiple translators
14 | # contributors:
15 | # - name: "Jan Doe" # Replace Jan Doe with contributor name, or delete this line if none
16 | # - name: "Jan Doe" # Replace Jan Doe with name, or delete this line if not multiple contributors
17 |
18 | github:
19 | branch: 'master-2.0'
20 | repository: w3c/wai-tutorials
21 | path: 'content/images/decision-tree.id.md' # Add the language shortcode to the middle of the filename, for example: content/index.fr.md
22 |
23 | resource:
24 | ref: /tutorials/images/ # Do not change this
25 |
26 | navigation:
27 | previous: /tutorials/images/imagemap/ # Do not change this
28 | next: /tutorials/images/tips/ # Do not change this
29 |
30 | permalink: /tutorials/images/decision-tree/id # Add the language shortcode to the end, with no slash at end, for example: /link/to/page/fr
31 | ref: /tutorials/images/decision-tree/ # Do not change this
32 |
33 | # In the footer below:
34 | # Translate the Working Group name. Leave the Working Group acronym in English.
35 | metafooter: true
36 | editors:
37 | - Eric Eggert: "https://www.w3.org/People/yatil/"
38 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
39 | update_editors:
40 | - Brian Elton
41 | contributing_participants:
42 | - lihat Pengakuan kontribusi
43 | support: Dikembangkan oleh Kelompok Developed by the Kelompok Kerja Edukasi dan Pendampingan (EOWG ). Dikembangkan dengan dukungan dari proyek WAI-ACT , didanai bersama oleh Program IST Komisi Eropa .
44 | ---
45 |
46 | {::nomarkdown}
47 | {% include box.html type="start" h="2" title="Gambaran Umum" class="full" %}
48 | {:/}
49 |
50 | Pohon keputusan ini menjelaskan cara menggunakan atribut `alt` dari elemen ` ` dalam berbagai situasi. Untuk beberapa jenis gambar, terdapat pendekatan alternatif, seperti menggunakan gambar latar CSS untuk gambar dekoratif atau fon web sebagai pengganti gambar teks.
51 |
52 | {::nomarkdown}
53 | {% include box.html type="end" %}
54 | {:/}
55 |
56 | - **Apakah gambar tersebut mengandung teks?**
57 | - {:.yes} **Ya:**
58 | - **… dan teks pada gambar tersebut juga tersedia secara tertulis di dekatnya.**
59 | _Gunakan atribut `alt` kosong. Lihat [Gambar Dekoratif](/tutorials/images/decorative/)._
60 | - **… dan teks tersebut ditampilkan hanya untuk efek visual.**
61 | _Gunakan atribut `alt` kosong. Lihat [Gambar Dekoratif](/tutorials/images/decorative/)._
62 | - **… dan teks tersebut memiliki fungsi yang spesifik, misalnya sebagai ikon.**
63 | _Gunakan atribut `alt` untuk mengkomunikasikan fungsi dari gambar. Lihat [Gambar Fungsional](/tutorials/images/functional/)._
64 | - **… dan teks pada gambar tidak tersedia di tempat lain.** _Gunakan atribut `alt` untuk menyertakan teks pada gambar. Lihat [Gambar Teks](/tutorials/images/textual/#styled-text-decorative-effect)._
65 | - {:.no} **Tidak:**
66 | - Lanjut.
67 | - **Apakah gambar digunakan dalam tautan atau tombol, dan jika gambar dihilangkan apakah fungsi tautan atau tombol tersebut akan sulit atau tidak bisa dimengerti?**
68 | - {:.yes} **Ya:**
69 | - _Gunakan atribut `alt` untuk mengkomunikasikan halaman tujuan dari tautan atau aksi yang akan dijalankan. Lihat [Gambar Fungsional](/tutorials/images/functional/)._
70 | - {:.no} **Tidak:**
71 | - Lanjut.
72 | - **Apakah gambar tersebut berkontribusi secara makna pada halaman atau konteks saat ini?**
73 | - {:.yes} **Ya:**
74 | - **… dan merupakan grafik atau foto yang sederhana.**
75 | _Gunakan deskripsi singkat yang bisa menyampaikan makna gambar pada atribut `alt`. Lihat [Gambar Informatif](/tutorials/images/informative/)._
76 | - **… dan merupakan grafik atau penggalan informasi yang kompleks.**
77 | _Sertakan informasi yang terkandung dalam gambar di tempat lain pada halaman. Lihat [Gambar Kompleks](/tutorials/images/complex/)._
78 | - **… dan merupakan konten duplikat pada teks *sungguhan* yang tertulis di dekatnya.**
79 | _Gunakan atribut `alt` kosong. Lihat (redundant) [Gambar Fungsional](/tutorials/images/functional/#logo-image-within-link-text)._
80 | - {:.no} **Tidak:**
81 | - Lanjut.
82 | - **Apakah gambar tersebut murni dekoratif atau tidak ditujukan kepada pengguna?**
83 | - {:.yes} **Ya:**
84 | - _Gunakan atribut `alt` kosong. Lihat [Gambar Dekoratif](/tutorials/images/decorative/)._
85 | - {:.no} **Tidak:**
86 | - Lanjut.
87 | - **Apakah kegunaan gambar tidak tercantum di atas atau tidak jelas `alt` teks apa yang perlu diberikan?**
88 | - {:.yes} Pohon keputusan ini **tidak** mencakup semua kasus. Untuk informasi lebih rinci mengenai pemberian alternatif teks lihat pada [Halaman Konsep Terkait Gambar](/tutorials/images/).
89 | {:.decision-tree}
--------------------------------------------------------------------------------
/content/images/decision-tree.ja.md:
--------------------------------------------------------------------------------
1 | ---
2 | # Translation instructions are after the "#" character in this first section. They are comments that do not show up in the web page. You do not need to translate the instructions after "#".
3 | # In this first section, do not translate the words before a colon. For example, do not translate "title:". Do translate the text after "title:".
4 |
5 | title: "altディシジョンツリー"
6 | title_html: "alt
ディシジョンツリー"
7 | lang: ja
8 | last_updated: 2024-02-23 # Put the date of this translation YYYY-MM-DD (with month in the middle)
9 |
10 | translators:
11 | - name: "Hiroya UGA"
12 | contributors:
13 | - name: "Naoki Nakamura"
14 |
15 | github:
16 | branch: "master-2.0"
17 | repository: w3c/wai-tutorials
18 | path: "content/images/decision-tree.ja.md"
19 |
20 | resource:
21 | ref: /tutorials/images/ # Do not change this
22 |
23 | navigation:
24 | previous: /tutorials/images/imagemap/ # Do not change this
25 | next: /tutorials/images/tips/ # Do not change this
26 |
27 | permalink: /tutorials/images/decision-tree/ja
28 | ref: /tutorials/images/decision-tree/ # Do not change this
29 |
30 | # In the footer below:
31 | # Translate the Working Group name. Leave the Working Group acronym in English.
32 | metafooter: true
33 | editors:
34 | - Eric Eggert: "https://www.w3.org/People/yatil/"
35 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
36 | update_editors:
37 | - Brian Elton
38 | contributing_participants:
39 | - 詳細:謝辞
40 | support: 教育・啓発ワーキンググループ(EOWG )によって開発されました。このプロジェクトはWAI-ACTプロジェクト の支援を受けて開発され、欧州委員会IST プログラム の共同資金援助を受けています。
41 | # Read Translations Notes for this resource at https://github.com/w3c/wai-tutorials#readme
42 | ---
43 |
44 | {::nomarkdown}
45 | {% include box.html type="start" h="2" title="概要" class="full" %}
46 | {:/}
47 |
48 | このディシジョンツリー(決定木)は、` `要素の`alt`属性の使い方を状況に合わせて説明するものです。画像の種類によっては、装飾目的の画像の代わりにCSS背景画像を用いたり、文字画像の代わりにWebフォントを利用するなど、代替手段が存在します。
49 | {::nomarkdown}
50 | {% include box.html type="end" %}
51 | {:/}
52 |
53 | - **その画像はテキストを含んでいますか?**
54 | - {:.yes} **Yes:**
55 | - **かつ、そのテキストが*実際の*テキストとして近くに記載されている場合**
56 | _空の`alt`属性を利用します。詳細は[[装飾目的の画像]](/tutorials/images/decorative/)を参照してください。_
57 | - **かつ、そのテキストが視覚効果のためだけに表示されている場合**
58 | _空の`alt`属性を利用します。詳細は[[装飾目的の画像]](/tutorials/images/decorative/)を参照してください。_
59 | - **かつ、そのテキストがアイコンなど特定の機能を持つ場合**
60 | _`alt`属性を、画像の機能を伝えるために利用します。詳細は[[機能を持つ画像]](/tutorials/images/functional/)を参照してください。_
61 | - **かつ、画像内のテキストがそれ以外の場所に存在しない場合** _`alt`属性にはその画像内のテキストを含めます。詳細は[[文字画像]](/tutorials/images/textual/#styled-text-decorative-effect)を参照してください。_
62 | - {:.no} **No:**
63 | - 次へ
64 | - **その画像はリンクまたはボタンの中で使用されていますか?また、画像が存在しない場合はリンクまたはボタンがどのような動作をするか理解することが困難または不可能ですか?**
65 | - {:.yes} **Yes:**
66 | - _`alt`属性を、リンク先または実行されるアクションを伝えるために利用します。詳細は[[機能を持つ画像]](/tutorials/images/functional/)を参照してください。_
67 | - {:.no} **No:**
68 | - 次へ
69 | - **その画像は現在のページまたは文脈に意味を与えていますか?**
70 | - {:.yes} **Yes:**
71 | - **かつ、その画像が単純なグラフィックまたは写真の場合**
72 | _意味が伝わるように画像の簡単な説明を`alt`属性値に利用します。詳細は[[意味のある画像]](/tutorials/images/informative/)を参照してください。_
73 | - **かつ、その画像がグラフまたは複雑な情報の一部の場合**
74 | _その画像に含まれている情報を、そのページ内の別の場所に含めます。詳細は[[複雑な画像]](/tutorials/images/complex/)を参照してください。_
75 | - **かつ、その画像が近くに記載されている*実際の*テキストと重複する内容を表している場合**
76 | _空の`alt`属性を利用します。詳細は(冗長な)[[機能を持つ画像]](/tutorials/images/functional/#logo-image-within-link-text)を参照してください。_
77 | - {:.no} **No:**
78 | - 次へ
79 | - **その画像は純粋な装飾目的、またはユーザー向けではないものですか?**
80 | - {:.yes} **Yes:**
81 | - _空の`alt`属性を利用します。詳細は[[装飾目的の画像]](/tutorials/images/decorative/)を参照してください。_
82 | - {:.no} **No:**
83 | - 次へ
84 | - **その画像の用途は上記に記載されていないですか?またはどのような代替テキストを提供するべきか不明ですか?**
85 | - {:.yes} この決定木はすべてのケースを網羅するわけでは**ありません**。代替テキストの提供に関する詳細については、「[[画像に関する概念ページ]](/tutorials/images/)」を参照してください。
86 | {:.decision-tree}
87 |
--------------------------------------------------------------------------------
/content/images/decision-tree.ko.md:
--------------------------------------------------------------------------------
1 | ---
2 | # Translation instructions are after the "#" character in this first section. They are comments that do not show up in the web page. You do not need to translate the instructions after "#".
3 | # In this first section, do not translate the words before a colon. For example, do not translate "title:". Do translate the text after "title:".
4 |
5 | title: "alt 의사결정나무"
6 | title_html: "alt
의사결정나무"
7 | lang: ko # Change "en" to the translated-language shortcode
8 | last_updated: 2024-03-12 # Put the date of this translation YYYY-MM-DD (with month in the middle)
9 |
10 | translators:
11 | - name: "hwahyeon"
12 |
13 | github:
14 | branch: 'master-2.0'
15 | repository: w3c/wai-tutorials
16 | path: 'content/images/decision-tree.ko.md' # Add the language shortcode to the middle of the filename, for example: content/index.fr.md
17 |
18 | resource:
19 | ref: /tutorials/images/ # Do not change this
20 |
21 | navigation:
22 | previous: /tutorials/images/imagemap/ # Do not change this
23 | next: /tutorials/images/tips/ # Do not change this
24 |
25 | permalink: /tutorials/images/decision-tree/ko # Add the language shortcode to the end, with no slash at end, for example: /link/to/page/fr
26 | ref: /tutorials/images/decision-tree/ # Do not change this
27 |
28 | # In the footer below:
29 | # Translate the Working Group name. Leave the Working Group acronym in English.
30 | metafooter: true
31 | editors:
32 | - Eric Eggert: "https://www.w3.org/People/yatil/"
33 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
34 | update_editors:
35 | - Brian Elton
36 | contributing_participants:
37 | - 감사의 말 보기
38 | support: 교육 및 원조 워킹 그룹(EOWG )에 의해 개발되었습니다.WAI-ACT 프로젝트 의 지원을 받아 개발되었으며, 유럽 위원회 IST 프로그램 이 공동 자금을 지원합니다.
39 | # Read Translations Notes for this resource at https://github.com/w3c/wai-tutorials#readme
40 | ---
41 |
42 | {::nomarkdown}
43 | {% include box.html type="start" h="2" title="Overview" class="full" %}
44 | {:/}
45 |
46 | 이 의사결정트리는 다양한 상황에서 ` ` 요소의 `alt` 속성을 사용하는 방법에 대해 설명합니다. 이미지 유형에 따라, 장식용 이미지로 CSS 배경 이미지를 사용하거나 이미지로 된 문자 대신 웹 글꼴을 사용하는 등의 대안이 있습니다.
47 | {::nomarkdown}
48 | {% include box.html type="end" %}
49 | {:/}
50 |
51 | - **이미지에 텍스트가 포함되어 있습니까?**
52 | - {:.yes} **예:**
53 | - **동시에, 이 텍스트가 이미지 근처에 *실제* 텍스트로도 표시되고 있는 경우**
54 | _빈 `alt` 속성을 사용하세요. 자세한 내용은 [장식용 이미지](/tutorials/images/decorative/)를 참조하세요._
55 | - **동시에, 이 텍스트가 오로지 시각적 효과를 위해서만 표시되고 있는 경우**
56 | _빈 `alt` 속성을 사용하세요. 자세한 내용은 [장식용 이미지](/tutorials/images/decorative/)를 참조하세요._
57 | - **동시에, 이 텍스트가 아이콘과 같이 특수한 기능을 가지고 있는 경우**
58 | _`alt` 속성을 사용하여 이미지의 기능을 나타냅니다. [기능적 이미지](/tutorials/images/functional/)를 참조하세요._
59 | - **동시에, 이미지 안의 텍스트가 이 이미지를 제외한 다른 방식으로는 제공되지 않는 경우.** _`alt` 속성을 사용하여 이 이미지 안의 텍스트를 포함하십시오. [텍스트 이미지](/tutorials/images/textual/#styled-text-decorative-effect)를 참조하세요._
60 | - {:.no} **아니요:**
61 | - 다음 단계로
62 | - **이미지가 링크나 버튼에 사용되며, 만약 이 이미지가 없다면 링크나 버튼의 기능을 이해하기 어렵거나 불가능합니까?**
63 | - {:.yes} **예:**
64 | - _`alt` 속성을 사용하여 링크의 목적지나 수행한 작업의 의미를 전달하세요. [기능적 이미지](/tutorials/images/functional/)를 참조하세요._
65 | - {:.no} **아니요:**
66 | - 다음 단계로
67 | - **이미지가 현재 페이지나 맥락에 의미를 부여합니까?**
68 | - {:.yes} **예:**
69 | - **동시에, 이미지가 간단한 그래픽이나 사진인 경우**
70 | _이미지의 간단한 설명을 `alt` 속성값에 넣어 해당 이미지의 의미를 전달하세요. [정보를 제공하는 이미지](/tutorials/images/informative/)를 참조하세요._
71 | - **동시에, 이미지가 그래프이거나 복잡한 정보인 경우**
72 | _이미지에 포함된 정보를 페이지의 다른 곳에 포함시킵니다. [복잡한 이미지](/tutorials/images/complex/)를 참조하세요._
73 | - **동시에, 이미지가 이미지 근처의 *실제* 텍스트와 중복되는 콘텐츠를 표시하는 경우.**
74 | _빈 `alt` 속성을 사용하세요. (중복) [기능적 이미지](/tutorials/images/functional/#logo-image-within-link-text)를 참조하세요._
75 | - {:.no} **아니요:**
76 | - 다음 단계로
77 | - **이미지가 순수하게 장식을 위한 것이거나 혹은 사용자를 위한 목적이 아닙니까?**
78 | - {:.yes} **예:**
79 | - _빈 `alt` 속성을 사용하세요. [장식용 이미지](/tutorials/images/decorative/)를 참조하세요._
80 | - {:.no} **아니요:**
81 | - 다음 단계로
82 | - **이미지의 용도가 위에 나열되지 않았거나 어떤 `alt` 텍스트를 제공해야 하는지 불분명합니까?**
83 | - {:.yes} 이 의사결정나무는 모든 경우를 다루지 **않습니다**. 대체 텍스트 제공에 대한 자세한 내용은 [이미지 개념 페이지](/tutorials/images/)를 참조하십시오.
84 | {:.decision-tree}
85 |
--------------------------------------------------------------------------------
/content/images/decision-tree.md:
--------------------------------------------------------------------------------
1 | ---
2 | # Translation instructions are after the "#" character in this first section. They are comments that do not show up in the web page. You do not need to translate the instructions after "#".
3 | # In this first section, do not translate the words before a colon. For example, do not translate "title:". Do translate the text after "title:".
4 |
5 | title: "An alt Decision Tree"
6 | title_html: "An alt
Decision Tree"
7 | lang: en # Change "en" to the translated-language shortcode
8 | last_updated: 2024-05-13 # Put the date of this translation YYYY-MM-DD (with month in the middle)
9 |
10 | # translators: # remove from the beginning of this line and the lines below: "# " (the hash sign and the space)
11 | # - name: "Translator Name Here" # Add one -name: line for every translator
12 | # - name: "Jan Doe" # Replace Jan Doe with translator name
13 | # - name: "Jan Doe" # Replace Jan Doe with name, or delete this line if not multiple translators
14 | # contributors:
15 | # - name: "Jan Doe" # Replace Jan Doe with contributor name, or delete this line if none
16 | # - name: "Jan Doe" # Replace Jan Doe with name, or delete this line if not multiple contributors
17 |
18 | github:
19 | branch: 'master-2.0'
20 | repository: w3c/wai-tutorials
21 | path: 'content/images/decision-tree.md' # Add the language shortcode to the middle of the filename, for example: content/index.fr.md
22 |
23 | resource:
24 | ref: /tutorials/images/ # Do not change this
25 |
26 | navigation:
27 | previous: /tutorials/images/imagemap/ # Do not change this
28 | next: /tutorials/images/tips/ # Do not change this
29 |
30 | permalink: /tutorials/images/decision-tree/ # Add the language shortcode to the end, with no slash at end, for example: /link/to/page/fr
31 | ref: /tutorials/images/decision-tree/ # Do not change this
32 |
33 | # In the footer below:
34 | # Translate the Working Group name. Leave the Working Group acronym in English.
35 | metafooter: true
36 | editors:
37 | - Eric Eggert: "https://www.w3.org/People/yatil/"
38 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
39 | update_editors:
40 | - Brian Elton
41 | contributing_participants:
42 | - see Acknowledgements
43 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
44 |
45 | # Read Translations Notes for this resource at https://github.com/w3c/wai-tutorials#readme
46 | ---
47 |
48 | {::nomarkdown}
49 | {% include box.html type="start" h="2" title="Overview" class="full" %}
50 | {:/}
51 |
52 | This decision tree describes how to use the `alt` attribute of the ` ` element in various situations. For some types of images, there are alternative approaches, such as using CSS background images for decorative images or web fonts instead of images of text.
53 |
54 | {::nomarkdown}
55 | {% include box.html type="end" %}
56 | {:/}
57 |
58 | - **Does the image contain text?**
59 | - {:.yes} **Yes:**
60 | - **… and the text is also present as *real* text nearby.**
61 | _Use an empty `alt` attribute. See [Decorative Images](/tutorials/images/decorative/)._
62 | - **… and the text is only shown for visual effects.**
63 | _Use an empty `alt` attribute. See [Decorative Images](/tutorials/images/decorative/)._
64 | - **… and the text has a specific function, for example is an icon.**
65 | _Use the `alt` attribute to communicate the function of the image. See [Functional Images](/tutorials/images/functional/)._
66 | - **… and the text in the image is not present otherwise.** _Use the `alt` attribute to include the text of the image. See [Images of Text](/tutorials/images/textual/#styled-text-decorative-effect)._
67 | - {:.no} **No:**
68 | - Continue.
69 | - **Is the image used in a link or a button, and would it be hard or impossible to understand what the link or the button does, if the image wasn’t there?**
70 | - {:.yes} **Yes:**
71 | - _Use the `alt` attribute to communicate the destination of the link or action taken. See [Functional Images](/tutorials/images/functional/)._
72 | - {:.no} **No:**
73 | - Continue.
74 | - **Does the image contribute meaning to the current page or context?**
75 | - {:.yes} **Yes:**
76 | - **… and it’s a simple graphic or photograph.**
77 | _Use a brief description of the image in a way that conveys that meaning in the `alt` attribute. See [Informative Images](/tutorials/images/informative/)._
78 | - **… and it’s a graph or complex piece of information.**
79 | _Include the information contained in the image elsewhere on the page. See [Complex Images](/tutorials/images/complex/)._
80 | - **… and it shows content that is redundant to *real* text nearby.**
81 | _Use an empty `alt` attribute. See (redundant) [Functional Images](/tutorials/images/functional/#logo-image-within-link-text)._
82 | - {:.no} **No:**
83 | - Continue.
84 | - **Is the image purely decorative or not intended for users?**
85 | - {:.yes} **Yes:**
86 | - _Use an empty `alt` attribute. See [Decorative Images](/tutorials/images/decorative/)._
87 | - {:.no} **No:**
88 | - Continue.
89 | - **Is the image’s use not listed above or it’s unclear what `alt` text to provide?**
90 | - {:.yes} This decision tree **does not** cover all cases. For detailed information on the provision of text alternatives refer to the [[Images Tutorials]](/tutorials/images/).
91 | {:.decision-tree}
92 |
--------------------------------------------------------------------------------
/content/images/decorative.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Decorative Images"
3 | permalink: /tutorials/images/decorative/
4 | ref: /tutorials/images/decorative/
5 | lang: en
6 | description:
7 | image: /content-images/wai-tutorials/images/social.png
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/images/decorative.md'
12 |
13 | resource:
14 | ref: /tutorials/images/
15 | navigation:
16 | previous: /tutorials/images/informative/
17 | next: /tutorials/images/functional/
18 |
19 | wcag_techniques:
20 | - H2
21 | - H67
22 |
23 | metafooter: true
24 | last_updated: 2019-07-27
25 | editors:
26 | - Eric Eggert: "https://www.w3.org/People/yatil/"
27 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
28 | update_editors:
29 | - Brian Elton
30 | contributing_participants:
31 | - see Acknowledgements
32 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
33 | ---
34 |
35 | {::nomarkdown}
36 | {% include box.html type="start" h="2" title="Overview" class="full" %}
37 | {:/}
38 |
39 | Decorative images don’t add information to the content of a page. For example, the information provided by the image might already be given using adjacent text, or the image might be included to make the website more visually attractive.
40 |
41 | In these cases, a null (empty) `alt` text should be provided (`alt=""`) so that they can be ignored by assistive technologies, such as screen readers. Text values for these types of images would add audible clutter to screen reader output or could distract users if the topic is different from that in adjacent text. Leaving out the `alt` attribute is also not an option because when it is not provided, some screen readers will announce the file name of the image instead.
42 |
43 | Whether to treat an image as decorative or [informative](/tutorials/images/informative/) is a judgment that only the author can make, based on the reason for including the image on the page. Images may be decorative when they are:
44 |
45 | - Visual styling such as borders, spacers, and corners;
46 | - Supplementary to link text to improve its appearance or increase the clickable area;
47 | - Illustrative of adjacent text but not contributing information (“eye-candy”);
48 | - Identified and described by surrounding text.
49 |
50 | The examples below show how to use the `alt` attribute when decorative images are provided using the ` ` element. Where possible, decorative images should be provided using CSS background images instead.
51 |
52 | {::nomarkdown}
53 | {% include box.html type="end" %}
54 | {:/}
55 |
56 | {% include_cached toc.html %}
57 |
58 | ## **Example 1:** Image used as part of page design
59 |
60 | This image is used as a border in the page design and has a purely
61 | decorative purpose.
62 |
63 | {::nomarkdown}
64 | {% include box.html type="start" title="Example" class="example" %}
65 | {:/}
66 |
67 | 
68 |
69 | {::nomarkdown}
70 | {% include box.html type="end" %}
71 | {:/}
72 |
73 | {::nomarkdown}
74 | {% include box.html type="start" title="Code" class="example" %}
75 | {:/}
76 |
77 | ~~~ html
78 |
79 | ~~~
80 |
81 | {::nomarkdown}
82 | {% include box.html type="end" %}
83 | {:/}
84 |
85 | Screen readers also allow the use of WAI-ARIA to hide elements by using `role="presentation"`. However, currently, this feature is not as widely supported as using a null `alt` attribute.
86 |
87 | {::nomarkdown}
88 | {% include box.html type="start" title="Code" class="example" %}
89 | {:/}
90 |
91 | ~~~ html
92 |
93 | ~~~
94 |
95 | {::nomarkdown}
96 | {% include box.html type="end" %}
97 | {:/}
98 |
99 | {::nomarkdown}
100 | {% include box.html type="start" title="Note" class="simple note" %}
101 | {:/}
102 |
103 | If the image was used to indicate a thematic break, e.g. a scene change in a story, or a transition to another topic, using the ` ` element would be appropriate to notify assistive technology.
104 |
105 | {::nomarkdown}
106 | {% include box.html type="end" %}
107 | {:/}
108 |
109 | ## **Example 2:** Decorative image as part of a text link
110 |
111 | This illustration of a crocus bulb is used to make the link easier to identify and to increase the clickable area but doesn’t add to the information already provided in the adjacent link text (of the same anchor). In this case, use a null (empty) `alt` value for the image.
112 |
113 | {::nomarkdown}
114 | {% include box.html type="start" title="Example" class="example" %}
115 | {:/}
116 |
117 | [{:style="vertical-align: middle; margin-right: 1em;"}**Crocus bulbs**](../beyond.html)
118 |
119 | {::nomarkdown}
120 | {% include box.html type="end" %}
121 | {:/}
122 |
123 | {::nomarkdown}
124 | {% include box.html type="start" title="Code" class="example" %}
125 | {:/}
126 |
127 | ~~~ html
128 |
129 |
130 | Crocus bulbs
131 |
132 | ~~~
133 |
134 | {::nomarkdown}
135 | {% include box.html type="end" %}
136 | {:/}
137 |
138 | ## **Example 3:** Image with adjacent text alternative
139 |
140 | This picture of a sleeping dog is already sufficiently described by the adjacent text. There is no need to repeat this information, and a null (empty) `alt` value can be used for this image.
141 |
142 | {::nomarkdown}
143 | {% include box.html type="start" title="Example" class="example" %}
144 | {:/}
145 |
146 | {:style="float:left; margin-right: 1em;"} **The sleeping dog:** Let sleeping dogs lie is a proverb that means “don’t initiate trouble. If something that could be troublesome is quiet, then leave it alone”.
147 |
148 | {::nomarkdown}
149 | {% include box.html type="end" %}
150 | {:/}
151 |
152 | {::nomarkdown}
153 | {% include box.html type="start" title="Code" class="example" %}
154 | {:/}
155 |
156 | ~~~ html
157 |
158 |
159 | The sleeping dog: ...
160 |
161 | ~~~
162 |
163 | {::nomarkdown}
164 | {% include box.html type="end" %}
165 | {:/}
166 |
167 | ## **Example 4:** Image used for ambiance (eye-candy)
168 |
169 | This image is used only to add ambiance or visual interest to the page.
170 |
171 | {::nomarkdown}
172 | {% include box.html type="start" title="Example" class="example" %}
173 | {:/}
174 |
175 | {:style="float:left; margin-right: 1em;"} Don’t miss the impressive Tropical House – a huge greenhouse that displays examples of exotic plant-life from every tropical environment on the planet.
176 |
177 | {::nomarkdown}
178 | {% include box.html type="end" %}
179 | {:/}
180 |
181 | {::nomarkdown}
182 | {% include box.html type="start" title="Code" class="example" %}
183 | {:/}
184 |
185 | ~~~ html
186 |
187 | ~~~
188 |
189 | {::nomarkdown}
190 | {% include box.html type="end" %}
191 | {:/}
192 |
193 | {::nomarkdown}
194 | {% include box.html type="start" title="Note" class="simple note" %}
195 | {:/}
196 |
197 | If the purpose of this image was to identify a plant or convey other information, rather than just to improve the look of the page, it should probably be treated as [informative](/tutorials/images/informative/). The author determines the purpose for the use of the image.
198 |
199 | {::nomarkdown}
200 | {% include box.html type="end" %}
201 | {:/}
202 |
--------------------------------------------------------------------------------
/content/images/examples/2014-first-qtr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Long Description Example"
3 | permalink: /tutorials/images/examples/2014-first-qtr/
4 | backlink: /tutorials/images/complex/#image-containing-substantial-information
5 | lang: en
6 | description:
7 | image: /content-images/wai-tutorials/images/social.png
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/images/examples/2014-first-qtr.md'
12 |
13 | metafooter: true
14 | last_updated: 2015-02-16
15 | editors:
16 | - Eric Eggert: "https://www.w3.org/People/yatil/"
17 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
18 | update_editors:
19 | - Brian Elton
20 | contributing_participants:
21 | - see Acknowledgements
22 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
23 |
24 | wcag_techniques:
25 | - C22
26 | - G94
27 | ---
28 |
29 | {% include_cached toc.html %}
30 |
31 |
32 | ## Site visitors for example.com
33 |
34 | ### Overview
35 |
36 | The chart shows the website hits for the first quarter of 2014. It shows that Site 1 has more visitors than either of the other sites, but the number of visitors is decreasing. Site 2 has a fairly constant number of visitors, while for Site 3 page hits are increasing month on month.
37 |
38 | ### Values
39 |
40 | Numerical values presented on the image:
41 |
42 |
43 |
44 | 2014 First Quarter visitors per site (in thousands)
45 |
46 |
47 | Period
48 | Site 1
49 | Site 2
50 | Site 3
51 |
52 |
53 | Jan
54 | 135
55 | 112
56 | 92
57 |
58 |
59 | Feb
60 | 117
61 | 114
62 | 99
63 |
64 |
65 | March
66 | 96
67 | 111
68 | 126
69 |
70 |
71 | Qtr total
72 | 348
73 | 337
74 | 308
75 |
76 |
77 |
78 | ### Presentation
79 |
80 | The bar chart represents both the number of visitors per month for each website, and the total number of visitors per website for the entire quarter. Website visitors for each month are represented using columns lined up horizontally, with heights indicating the number of visitors. A fourth column is provided for each website with the accumulated site visitors for the quarter.
--------------------------------------------------------------------------------
/content/images/examples/imagemap.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Complete Image Maps Example"
3 | permalink: /tutorials/images/examples/imagemap/
4 | backlink: /tutorials/images/imagemap/an-organizational-chart-with-links-to-individual-pages
5 | lang: en
6 | description:
7 | image: /content-images/wai-tutorials/images/social.png
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/images/examples/imagemap.md'
12 |
13 | metafooter: true
14 | last_updated: 2018-08-01
15 | editors:
16 | - Eric Eggert: "https://www.w3.org/People/yatil/"
17 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
18 | update_editors:
19 | - Brian Elton
20 | contributing_participants:
21 | - see Acknowledgements
22 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
23 | ---
24 |
25 |
26 | {::nomarkdown}
27 | {% include box.html type="start" title="Example" class="example" %}
28 | {:/}
29 |
30 | {:usemap="#Map"}
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | {::nomarkdown}
41 | {% include box.html type="end" %}
42 | {:/}
43 |
44 | {::nomarkdown}
45 | {% include box.html type="start" title="Code" class="example" %}
46 | {:/}
47 |
48 | ~~~ html
49 |
50 |
53 |
54 |
55 |
61 |
62 |
68 |
74 |
80 |
86 |
87 |
88 | ~~~
89 |
90 | {::nomarkdown}
91 | {% include box.html type="end" %}
92 | {:/}
93 |
94 |
--------------------------------------------------------------------------------
/content/images/groups.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Groups of Images"
3 | permalink: /tutorials/images/groups/
4 | ref: /tutorials/images/groups/
5 | lang: en
6 | description:
7 | image: /content-images/wai-tutorials/images/social.png
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/images/groups.md'
12 |
13 | resource:
14 | ref: /tutorials/images/
15 | navigation:
16 | previous: /tutorials/images/complex/
17 | next: /tutorials/images/imagemap/
18 |
19 | wcag_techniques:
20 | - G196
21 | - H67
22 | - ARIA13
23 |
24 | metafooter: true
25 | last_updated: 2022-02-08
26 | editors:
27 | - Eric Eggert: "https://www.w3.org/People/yatil/"
28 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
29 | update_editors:
30 | - Brian Elton
31 | contributing_participants:
32 | - see Acknowledgements
33 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
34 | ---
35 |
36 | {::nomarkdown}
37 | {% include box.html type="start" h="2" title="Overview" class="full" %}
38 | {:/}
39 |
40 | Sometimes groups of images are used together to represent one piece of information. For example, a collection of star icons that together represent a rating. In this case, only one of the images needs a text alternative to describe the entire collection, while the other images have a null (empty) `alt` attribute so that they are ignored by assistive technology.
41 |
42 | In other cases, a group of images may represent a collection of related images. For example, showing a collection of art impressions that are thematically related. In this case, each image needs its text alternative that describes it individually, as well as its relationship within the group.
43 |
44 | {::nomarkdown}
45 | {% include box.html type="end" %}
46 | {:/}
47 |
48 | {% include_cached toc.html %}
49 |
50 | ## **Example 1:** Multiple images conveying a single piece of information
51 |
52 | This group of five images combined shows a product rating. There are five images (three filled stars, one half-filled star and one empty star) indicating the overall rating. The text alternative for the first image is “Rating: 3.5 out of 5 stars”. All other images have a null (empty) `alt` attribute (`alt=""`).
53 |
54 | {::nomarkdown}
55 | {% include box.html type="start" title="Example" class="example" %}
56 | {:/}
57 |
58 | Rating: 
59 |
60 | {::nomarkdown}
61 | {% include box.html type="end" %}
62 | {:/}
63 |
64 | {::nomarkdown}
65 | {% include box.html type="start" title="Code" class="example" %}
66 | {:/}
67 |
68 | ~~~ html
69 | Rating:
70 |
71 |
72 |
73 |
74 |
75 | ~~~
76 |
77 | {::nomarkdown}
78 | {% include box.html type="end" %}
79 | {:/}
80 |
81 | ## **Example 2:** A collection of images
82 |
83 | In the example below, the HTML5 `` and `` elements are used to provide a caption for each image in a collection. The `` element can be nested, which is used in the example to provide a caption for the entire collection of images. The WAI-ARIA attribute `role` with the value of `group` is used to indicate this grouping to assistive technologies, `aria-labelledby` makes sure that the `figcaption` elements are used as labels for the individual groups.
84 |
85 | Note: The web browser and assistive technology support vary for this particular WAI-ARIA attribute and value.
86 |
87 | {::nomarkdown}
88 | {% include box.html type="start" title="Example" class="example" %}
89 |
90 |
91 | The castle through the ages: 1423, 1756, and 1936 respectively.
92 |
93 |
94 |
95 |
96 | Charcoal on wood. Anonymous, circa 1423.
97 |
98 |
99 |
100 | Oil-based paint on canvas. Eloisa Faulkner, 1756.
101 |
102 |
103 |
105 | Film photograph. Séraphin Médéric Mieusement , 1936.
106 |
107 |
108 |
109 |
110 | {% include box.html type="end" %}
111 | {:/}
112 |
113 | {::nomarkdown}
114 | {% include box.html type="start" title="Code" class="example" %}
115 | {:/}
116 |
117 | ~~~ html
118 |
119 |
120 | The castle through the ages: 1423, 1756, and 1936 respectively.
121 |
122 |
123 |
124 |
125 |
127 | Charcoal on wood. Anonymous, circa 1423.
128 |
129 |
130 |
131 |
133 | Oil-based paint on canvas. Eloisa Faulkner, 1756.
134 |
135 |
136 |
137 |
139 | Film photograph. Séraphin Médéric Mieusement , 1936.
140 |
141 |
142 |
143 | ~~~
144 |
145 | {::nomarkdown}
146 | {% include box.html type="end" %}
147 | {:/}
148 |
149 |
--------------------------------------------------------------------------------
/content/images/imagemap.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Image Maps"
3 | permalink: /tutorials/images/imagemap/
4 | ref: /tutorials/images/imagemap/
5 | lang: en
6 | description:
7 | image: /content-images/wai-tutorials/images/social.png
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/images/imagemap.md'
12 |
13 | resource:
14 | ref: /tutorials/images/imagemap/
15 | navigation:
16 | previous: /tutorials/images/groups/
17 | next: /tutorials/images/decision-tree/
18 |
19 | wcag_techniques:
20 | - G196
21 | - H67
22 | - ARIA13
23 |
24 | metafooter: true
25 | last_updated: 2017-04-12
26 | editors:
27 | - Eric Eggert: "https://www.w3.org/People/yatil/"
28 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
29 | update_editors:
30 | - Brian Elton
31 | contributing_participants:
32 | - see Acknowledgements
33 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
34 | ---
35 |
36 | {::nomarkdown}
37 | {% include box.html type="start" h="2" title="Overview" class="full" %}
38 | {:/}
39 |
40 | A client-side image map is an image divided into selectable regions defined by ` ` elements (“hotspots”) that allow user interaction. Usually, the selectable regions are links to other pages. For image maps, text alternatives are needed on both the ` ` element itself (to convey the informative context) and on each of the ` ` elements (to convey the link destination or the action that will be initiated if the link is followed).
41 |
42 | {::nomarkdown}
43 | {% include box.html type="end" %}
44 | {:/}
45 |
46 | {% include_cached toc.html %}
47 |
48 | ## **Example 1:** An organizational chart with links to individual pages
49 |
50 | The following organizational chart is used to provide links to each director's home page. The text alternative for the image is “Board of Directors and related staff:”. Each linked ` ` has a text alternative to identify the individual -- for example, “Davy Jones: Chairman”. The text alternative for individuals also states their relation in the graph.
51 |
52 | {::nomarkdown}
53 | {% include box.html type="start" title="Example" class="example" %}
54 | {:/}
55 |
56 | {:usemap="#Map"}
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | {::nomarkdown}
67 | {% include box.html type="end" %}
68 | {:/}
69 |
70 | {::nomarkdown}
71 | {% include box.html type="start" title="Code" class="example" %}
72 | {:/}
73 |
74 | ~~~ html
75 |
78 |
79 |
83 | […]
84 |
88 | […]
89 |
90 | ~~~
91 |
92 | {::nomarkdown}
93 | {% include box.html type="end" %}
94 | {:/}
95 |
96 | [Full code for Image map example](/tutorials/images/examples/imagemap/)
97 |
98 | Browser implementation for image maps varies at the time of writing; see [this HTML bug](https://lists.w3.org/Archives/Public/public-html-bugzilla/2015Jan/0020.html). To accommodate for the different implementations, keep in mind to:
99 |
100 | * use every image map only once. That means if multiple images with the same map are to be used, the map should be duplicated and have a different `id`s;
101 | * place the `` element as a direct sibling to the image.
102 |
103 | {::nomarkdown}
104 | {% include box.html type="start" title="Note" class="simple notes" %}
105 | {:/}
106 |
107 | Image maps may not function correctly on some mobile devices if the coordinates for the areas are not scaled using the same proportions as the image. To compensate for this, provide redundant text links on the same page.
108 |
109 | {::nomarkdown}
110 | {% include box.html type="end" %}
111 | {:/}
112 |
--------------------------------------------------------------------------------
/content/images/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Images Tutorial"
3 | permalink: /tutorials/images/
4 | ref: /tutorials/images/
5 | lang: en
6 | last_updated: 2022-02-08
7 | description:
8 | image: /content-images/wai-tutorials/images/social.png
9 | github:
10 | branch: 'master-2.0'
11 | repository: w3c/wai-tutorials
12 | path: 'content/images/index.md'
13 | metafooter: true
14 |
15 | resource:
16 | ref: /tutorials/
17 | title: "Images Tutorials"
18 |
19 | navigation:
20 | next: /tutorials/images/informative/
21 |
22 | editors:
23 | - Eric Eggert: "https://www.w3.org/People/yatil/"
24 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
25 | update_editors:
26 | - Brian Elton
27 | contributing_participants:
28 | - see Acknowledgements
29 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
30 |
31 |
32 | wcag_success_criteria:
33 | - 1.1.1
34 | - 1.4.5
35 | - 1.4.9
36 | ---
37 |
38 | Images must have text alternatives that describe the information or function represented by them. This ensures that images can be used by [people with various disabilities](#why-is-this-important). This tutorial demonstrates how to provide appropriate text alternatives based on the purpose of the image:
39 |
40 | - **[Informative images](/tutorials/images/informative/)**: Images that graphically represent concepts and information, typically pictures, photos, and illustrations. The text alternative should be at least a short description conveying the essential information presented by the image.
41 |
42 | - **[Decorative images](/tutorials/images/decorative/)**: Provide a null text alternative (`alt=""`) when the only purpose of an image is to add visual decoration to the page, rather than to convey information that is important to understanding the page.
43 |
44 | - **[Functional images](/tutorials/images/functional/)**: The text alternative of an image used as a link or as a button should describe the functionality of the link or button rather than the visual image. Examples of such images are a printer icon to represent the print function or a button to submit a form.
45 |
46 | - **[Images of text](/tutorials/images/textual/)**: Readable text is sometimes presented within an image. If the image is not a logo, avoid text in images. However, if images of text are used, the text alternative should contain the same words as in the image.
47 |
48 | - **[Complex images](/tutorials/images/complex/)** such as graphs and diagrams: To convey data or detailed information, provide a complete text equivalent of the data or information provided in the image as the text alternative.
49 |
50 | - **[Groups of images](/tutorials/images/groups/)**: If multiple images convey a single piece of information, the text alternative for one image should convey the information for the entire group.
51 |
52 | - **[Image maps](/tutorials/images/imagemap/)**: The text alternative for an image that contains multiple clickable areas should provide an overall context for the set of links. Also, each individually clickable area should have alternative text that describes the purpose or destination of the link.
53 |
54 | For a quick overview on deciding which category a particular image fits into, see the [`alt` Decision Tree](/tutorials/images/decision-tree/). The text alternative needs to be determined by the author, depending on the usage, context, and content of an image. For example, the exact type and look of a bird in an image might be less relevant and described only briefly on a website about parks, but may be appropriate on a website specifically about birds.
55 |
56 | ## Why is this important?
57 |
58 | Images and graphics make content more pleasant and easier to understand for many people, and in particular for those with cognitive and learning disabilities. They serve as cues that are used by people with visual impairments, including people with low vision, to orient themselves in the content.
59 |
60 | However, images are used extensively on websites and can create major barriers when they are not accessible. Accessible images are beneficial in many situations, such as:
61 |
62 | - **People using screen readers:** The text alternative can be read aloud or rendered as Braille
63 | - **People using speech input software:** Users can put the focus onto a button or linked image with a single voice command
64 | - **People browsing speech-enabled websites:** The text alternative can be read aloud
65 | - **Mobile web users:** Images can be turned off, especially for data-roaming
66 | - **Search engine optimization:** Images become indexable by search engines
67 |
68 |
69 | {::nomarkdown}
70 | {% include box.html type="start" title="Note" class="simple" %}
71 | {:/}
72 |
73 | Removing images from websites (so-called “text-only versions”) make them less accessible and functional for these users and situations.
74 |
75 | {::nomarkdown}
76 | {% include box.html type="end" %}
77 | {:/}
78 |
--------------------------------------------------------------------------------
/content/images/tips.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Tips and Tricks"
3 | permalink: /tutorials/images/tips/
4 | ref: /tutorials/images/tips/
5 | lang: en
6 | description:
7 | image: /content-images/wai-tutorials/images/social.png
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/images/tips.md'
12 |
13 |
14 | resource:
15 | ref: /tutorials/images/
16 | navigation:
17 | previous: /tutorials/images/decision-tree/
18 |
19 | wcag_techniques:
20 |
21 | metafooter: true
22 | last_updated: 2017-04-12
23 | editors:
24 | - Eric Eggert: "https://www.w3.org/People/yatil/"
25 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
26 | update_editors:
27 | - Brian Elton
28 | contributing_participants:
29 | - see Acknowledgements
30 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
31 | ---
32 |
33 | - **Choosing appropriate text alternatives:**
34 | Imagine that you’re reading the web page aloud over the phone to someone who needs to understand the page. This should help you decide what (if any) information or function the images have. If they appear to have no informative value and aren’t links or buttons, it’s probably safe to treat them as [decorative](/tutorials/images/decorative/).
35 |
36 | - **Prioritize information in text alternative:**
37 | Aim to put the most important information at the beginning.
38 |
39 | - **Length of the text alternative:**
40 | The `alt` text should be the most concise description possible of the image’s purpose. If anything more than a short phrase or sentence is needed, it would be better to use one of the long description methods discussed in [complex images](/tutorials/images/complex/).
41 |
42 | - {% include ednote.html pr="527" repo="w3c/wai-tutorials" note="Add Responsive Design tip as proposed." status="proposed" %}
43 | **Responsive design:**
44 | Icons with text labels will often drop the text labels when viewed on smaller screens. Ensure that icons are readable at that size, understandable without text, and have text descriptions.
45 |
46 | - **Punctuation within `alt` attributes:**
47 |
48 | * As for any text, using punctuation in the text alternative makes the information easier to understand. In particular, remember to add space characters in the `alt` text when there’s no space character between the image and adjacent text, to avoid having words running together when they are read by a screen reader.
49 |
50 | * If you use a null (empty) text alternative (`alt=""`) to hide decorative images, make sure that there is no space character in between the quotes. If a space character is present, the image may not be effectively hidden from assistive technologies. For instance, some screen readers will still announce the presence of an image if a space character is put between the quotes.
51 |
52 | - **Superfluous information in the text alternative:**
53 | Usually, there’s no need to include words like “image”, “icon”, or “picture” in the alt text. People who can see will know this already, and screen readers announce the presence of an image. In some situations, it may be important to distinguish between paintings, photographs, or illustrations, etc., but it’s best to avoid the more generic use of the terms.
54 |
55 | - **SVG graphics:**
56 |
57 | * SVG graphics can be referenced in the `src` attribute of an ` ` element like other image formats (PNG, JPEG, GIF). In this case, the examples of this tutorial can be used with SVG as well.
58 |
59 | * As SVG images consist of tags like HTML, their code can also be used in HTML5 directly. In this case you can provide a text alternative in a `` element within the SVG image. To improve accessibility support, that title should be referenced from an `aria-labelledby` attribute of the `` element, for example:
60 |
61 | ` Settings [other svg code] `
62 |
63 | - **Logos:**
64 | Logo images with text are exempt from some of the accessibility requirements. For instance, there is no minimum contrast requirement.
65 |
66 | ## Other W3C Resources
67 |
68 | - Background information on [providing text alternatives for non-text content](https://www.w3.org/WAI/intro/people-use-web/principles#alternatives) in How People with Disabilities Use the Web.
69 | - Test the accessibility of images on your site: [Quick Checks Image text alternatives](https://www.w3.org/WAI/EO/Drafts/eval/checks#images).
70 | - Examples of good and bad practice in selecting text alternatives can be found in the [Before and After Demonstration](https://www.w3.org/WAI/demos/bad/) (BAD).
71 |
--------------------------------------------------------------------------------
/content/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Tutorials"
3 | permalink: /tutorials/
4 | ref: /tutorials/
5 | lang: en
6 |
7 | description:
8 | image: /content-images/wai-tutorials/images/social.png
9 | github:
10 | branch: 'master-2.0'
11 | repository: w3c/wai-tutorials
12 | path: 'content/index.md'
13 |
14 | footer: >
15 | Date: Updated 9 September 2022. First published September 2014. CHANGELOG.
16 | Editors: Eric Eggert, Shadi Abou-Zahra. Update Editor: Brian Elton. Contributors: Shawn Lawton Henry, Anna Belle Leiserson, Sharron Rush, Bim Egan, AG WG participants , EOWG participants . ACKNOWLEDGEMENTS.
17 | Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme.
18 |
19 | resource:
20 | ref: /tutorials/
21 |
22 | changelog: /tutorials/changelog/
23 | acknowledgements: /tutorials/acknowledgements/
24 |
25 | ---
26 |
27 | This collection of tutorials shows you how to develop web content that is accessible to people with disabilities, and that provides a better user experience for everyone.
28 |
29 | The tutorials are designed to be used by a variety of individuals, including:
30 |
31 | * **Web developers** will find guidance and boilerplate solutions for many common coding challenges.
32 | * **Web designers** will learn how to create web page components with a built-in inclusive design.
33 | * **Web trainers** will find examples to teach people about accessible web design and development.
34 | * **Content authors** will learn concepts and techniques for preparing their content in an accessible way.
35 | * **Project managers** will gain an understanding of ways to integrate accessibility into their projects.
36 |
37 | The tutorials cover various accessibility topics, based on common tasks in web projects. For example, they show you how to provide accessible images and tables using a variety of web technologies, including HTML4, HTML5, CSS3, WAI-ARIA, MathML, and SVG. The concepts and techniques explained in the tutorials apply to other formats as well.
38 |
39 | Web authoring tools (Content Management Systems (CMS), WYSIWYG editors, word processors, etc.) can often help you create content that is accessible as shown in these tutorials.
40 |
41 | ## Relationship to WCAG
42 |
43 | These tutorials provide best-practice guidance on implementing accessibility in different situations. They combine WCAG 2 success criteria and techniques from various conformance levels. Each tutorial page lists the specific success criteria and techniques used on that page. A more comprehensive coverage of the normative [WCAG 2.0](https://www.w3.org/TR/WCAG20/) and [WCAG 2.1](https://www.w3.org/TR/WCAG21/) standards and their supporting materials is provided in **[How to Meet WCAG 2: A customizable quick reference](https://www.w3.org/WAI/WCAG21/quickref/)**.
44 |
45 | ## Additional Resources
46 |
47 | * **[[How People with Disabilities Use the Web]](/people-use-web/):** An introduction covering a variety of disabilities, including age-related impairments
48 | * **[[Accessibility Principles]](/fundamentals/accessibility-principles/):** Introduces some of the web accessibility requirements for websites, web applications, browsers, and other tools
49 | * **[[Web Content Accessibility Guidelines (WCAG) Overview]](/standards-guidelines/wcag/):** Introduces the international standard that defines requirements on how to make web content more accessible to people with disabilities
50 | * **[[Authoring Tool Accessibility Guidelines (ATAG) Overview]](/standards-guidelines/atag/):** Introduces the international standard that defines requirements on how to make web authoring tools that support accessibility for people with disabilities
51 |
--------------------------------------------------------------------------------
/content/menus/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Menus Tutorial
3 | lang: en
4 | permalink: /tutorials/menus/
5 | ref: /tutorials/menus/
6 |
7 | github:
8 | branch: 'master-2.0'
9 | repository: w3c/wai-tutorials
10 | path: 'content/menus/index.md'
11 |
12 | resource:
13 | ref: /tutorials/
14 | navigation:
15 | next: /tutorials/menus/structure/
16 |
17 | wcag_success_criteria:
18 | - 2.4.1
19 | - 2.4.3
20 | - 2.4.5
21 | - 2.4.7
22 | - 2.4.8
23 | - 4.1.2
24 | wcag_techniques:
25 | - H4
26 | - SCR26
27 | - G65
28 | - G161
29 | - G63
30 | - G127
31 | - ARIA6
32 | - ARIA11
33 | - G14
34 | - G128
35 | - G182
36 | - G183
37 |
38 | metafooter: true
39 | first_published: "May 2015"
40 | last_updated: 2017-04-13
41 | editors:
42 | - Eric Eggert: "https://www.w3.org/People/yatil/"
43 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
44 | update_editors:
45 | - Brian Elton
46 | contributing_participants:
47 | - see Acknowledgements
48 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
49 | ---
50 | Menus are used for navigation and to provide functionality which are critical parts of web page operability.
51 |
52 | * **[Structure](/tutorials/menus/structure/):** Mark up menus in a way that reflects their structure and appropriately labels them.
53 |
54 | * **[Styling](/tutorials/menus/styling/):** Use commonly recognized design patterns to distinguish menus and the state of menu items.
55 |
56 | * **[Fly-out Menus](/tutorials/menus/flyout/):** Ensure fly-out (drop-down) submenus can be used appropriately by mouse and keyboard.
57 |
58 | * **[Application Menus](/tutorials/menus/application-menus/):** Add specific markup and keyboard behavior to resemble desktop application menus.
59 |
60 | ## Why is this important?
61 |
62 | Navigation menus reflect the underlying structure of websites. Application menus provide access to the essential functionality of an application. Thus menus are critical parts of web pages and applications and require particular attention during design and development.
63 |
64 | * **Screen reader and keyboard users** benefit from keyboard interoperability and markup that allows them to operate menus in different ways.
65 |
66 | * **Users with fine motor difficulties and touch screen users** require larger targets to click or tap on. In fly-out menus, submenus should not disappear immediately after the mouse has left the clickable area.
67 |
68 | * **People with limited attention or short-term memory** benefit from clear and distinct menus with easily identifiable states, such as the current page.
69 |
--------------------------------------------------------------------------------
/content/menus/structure.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Menu Structure
3 |
4 | lang: en
5 | permalink: /tutorials/menus/structure/
6 | ref: /tutorials/menus/structure/
7 |
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/menus/structure.md'
12 |
13 | resource:
14 | ref: /tutorials/menus/
15 | navigation:
16 | previous: /tutorials/menus/
17 | next: /tutorials/menus/styling/
18 |
19 | wcag_success_criteria:
20 | - 4.1.2
21 | wcag_techniques:
22 | - ARIA6
23 | - ARIA11
24 |
25 | metafooter: true
26 | last_updated: 2024-05-13
27 | editors:
28 | - Eric Eggert: "https://www.w3.org/People/yatil/"
29 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
30 | update_editors:
31 | - Brian Elton
32 | contributing_participants:
33 | - see Acknowledgements
34 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
35 | ---
36 |
37 | {::nomarkdown}
38 | {% include box.html type="start" h="2" title="Overview" class="full" %}
39 | {:/}
40 |
41 | Semantic markup conveys the menu structure to users. Menus coded semantically can easily adapt to different situations, such as small screen displays, screen magnification, and other assistive technology.
42 |
43 | {::nomarkdown}
44 | {% include box.html type="end" %}
45 | {:/}
46 |
47 | {% include_cached toc.html %}
48 |
49 |
50 | ## Menu representation
51 | {:.newap}
52 |
53 | Convey the menu structure, typically by using a list. Such structural information allows assistive technologies to announce the number of items in the menu and provide corresponding navigation functionality.
54 |
55 | ### Unordered list
56 | {:.ap}
57 |
58 | Use an unordered list (``) when the menu items are not in a specific order. Most types of menus, such as website navigation, fall in this category.
59 |
60 | {::nomarkdown}
61 | {% include box.html type="start" title="Code: Unordered List" class="example" %}
62 | {:/}
63 |
64 | ~~~ html
65 |
73 | ~~~
74 |
75 | {::nomarkdown}
76 | {% include box.html type="end" %}
77 | {:/}
78 |
79 |
80 | ### Ordered list
81 | {:.ap}
82 |
83 | Use an ordered list (``) when the sequence of the menu items is important. In the following example, the menu items represent the steps of a construction manual:
84 |
85 | {::nomarkdown}
86 | {% include box.html type="start" title="Code: Ordered List" class="example" %}
87 | {:/}
88 |
89 | ~~~ html
90 |
91 | Unpacking the Space Craft
92 | Check Contents of Package
93 | Build Chassis
94 | Build Engine
95 | Mount Engine to Chassis
96 | …
97 |
98 | ~~~
99 |
100 | {::nomarkdown}
101 | {% include box.html type="end" %}
102 | {:/}
103 |
104 | ## Identify menus
105 |
106 | Identify the menu, ideally using the HTML5 `` element to allow users access to the menu directly. Other techniques to mark up a menu are described in the [page regions](/tutorials/page-structure/regions/) tutorial.
107 |
108 | {::nomarkdown}
109 | {% include box.html type="start" title="Code: HTML" class="example" %}
110 | {:/}
111 |
112 | ~~~ html
113 |
114 |
117 |
118 | ~~~
119 |
120 | {::nomarkdown}
121 | {% include box.html type="end" %}
122 | {:/}
123 |
124 | ## Label menus
125 | {:.newap}
126 |
127 | Label menus to make them easier to find and understand. Labels should be short but descriptive, to allow users to distinguish between multiple menus on a web page. Use a heading, `aria-label`, or `aria-labelledby` to provide the label. Those techniques are described in the [labeling regions](/tutorials/page-structure/labels/) tutorial.
128 |
129 | {::nomarkdown}
130 | {% include box.html type="start" title="Code: HTML" class="example" %}
131 | {:/}
132 |
133 | ~~~ html
134 |
135 | Main Menu
136 |
137 | ~~~
138 |
139 | {::nomarkdown}
140 | {% include box.html type="end" %}
141 | {:/}
142 |
143 | ## Indicate the current item
144 |
145 | Use markup to indicate the current item of a menu, such as the current page on a website, to improve orientation in the menu.
146 |
147 | ### Using invisible text
148 | {:.ap}
149 |
150 | Provide an invisible label that is read aloud to screen reader users and used by other assistive technologies to mark the current item which allows custom label text.
151 |
152 | Remove the anchor (``), so users cannot interact with the current item. That avoids misunderstandings and emphasizes that the current menu item is active.
153 |
154 | In the following example, the menu item has the invisible text “Current Page:” and the ` ` element is replaced by a `` with a class `current`:
155 |
156 | {::nomarkdown}
157 | {% include box.html type="start" title="Code: HTML" class="example" %}
158 | {:/}
159 |
160 | ~~~ html
161 |
162 |
163 | Current Page:
164 | Space Bears
165 |
166 |
167 | ~~~
168 | {::nomarkdown}
169 | {% include box.html type="end" %}
170 | {:/}
171 |
172 | ### Using WAI-ARIA
173 | {:.ap}
174 |
175 | Use the `aria-current="page"` attribute to indicate the current page in the menu. This technique is particularly useful when the anchor (``) cannot be removed from the HTML.
176 |
177 | In the following example the link in the navigation points to the main content of the page.
178 |
179 | {::nomarkdown}
180 | {% include box.html type="start" title="Code: HTML" class="example" %}
181 | {:/}
182 |
183 | ~~~ html
184 |
185 |
186 | Space Bears
187 |
188 |
189 | ~~~
190 |
191 | {::nomarkdown}
192 | {% include box.html type="end" %}
193 | {:/}
194 |
195 | ## Responsive design
196 | Menu structure should be consistent across screen sizes. Some menu items may be collapsed or even hidden in sub navigation menus, but items that show should appear in the same order and with the same wording and destination.
197 |
--------------------------------------------------------------------------------
/content/menus/styling.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Menu Styling
3 |
4 | lang: en
5 | permalink: /tutorials/menus/styling/
6 | ref: /tutorials/menus/styling/
7 |
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: 'content/menus/styling.md'
12 |
13 | resource:
14 | ref: /tutorials/menus/
15 | navigation:
16 | previous: /tutorials/menus/structure/
17 | next: /tutorials/menus/flyout/
18 |
19 | wcag_success_criteria:
20 | - 1.4.1
21 | wcag_techniques:
22 | - G14
23 | - G128
24 | - G182
25 | - G183
26 |
27 | metafooter: true
28 | last_updated: 2022-09-20
29 | editors:
30 | - Eric Eggert: "https://www.w3.org/People/yatil/"
31 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
32 | update_editors:
33 | - Brian Elton
34 | contributing_participants:
35 | - see Acknowledgements
36 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
37 | ---
38 |
39 | {::nomarkdown}
40 | {% include box.html type="start" h="2" title="Overview" class="full" %}
41 | {:/}
42 |
43 | Clear and consistent styling allows users to find and recognize menus more quickly. Such styling includes consistency in the behavior, appearance, and relative location on pages across a website.
44 |
45 | {::nomarkdown}
46 | {% include box.html type="end" %}
47 | {:/}
48 |
49 | {% include_cached toc.html %}
50 |
51 | ## General considerations
52 |
53 | Menus often use images, such as icons, that can be decorative or communicate functionality. These images require text alternatives, as described in the [Images Tutorial](/tutorials/images/). Contrast requirements are also applicable to menus and their items.
54 |
55 | ### Location
56 |
57 | Display the menu where the target audience of the website expects it. For example, on websites, the main navigation menu is commonly located either vertically on the left of the pages (in left-to-right languages), or horizontally across the top. Application menus are usually expected horizontally across the top.
58 |
59 | ### Identification
60 |
61 | Ensure that menus and their items are identifiable as such. In addition to the structural markup discussed in the previous section, the color scheme is necessary to communicate the presence of menus and items visually.
62 |
63 | Consider making the label of menus visible to everyone. For example, in these tutorials, the "Menus Tutorial", "All Tutorials", "On this page" are menu labels provided as visible headings that are available for all users.
64 |
65 | ### Readability
66 |
67 | Ensure appropriate sizing of menus and menu items to fit all text. The menu size should also adapt to varying text sizes, to accommodate languages with longer words and people who need larger text. Where possible avoid all uppercase text, line breaks, and hyphenation, as these are often distracting and hard to read.
68 |
69 | ### Size
70 |
71 | Provide sufficient white space, like padding, to support people with reduced dexterity and small touch screens on mobile devices. At the same time, make sure that menus do not overlap themselves and other content of the page when users increase the text size or zoom the page.
72 |
73 | ## Menu items
74 |
75 | Convey menu items and their states by using color and other styling options. Don’t rely on color alone as some users will be unable to perceive such changes. For example, alter the shape of a menu item, or add an icon, in addition to changing its color when it is selected.
76 |
77 | ### Default state
78 |
79 | Use distinct styling to visually indicate menu items as regions of the page that can be activated. However, avoid exaggerated text decoration, such as words in upper case or small caps, as these make text harder to read.
80 |
81 | ### Hover and Focus states
82 |
83 | Change hovered or focused menu items, which gives users visual guidance when navigating the menu. In this example, hover and focus states use an inverted color scheme (blue on white instead of white on blue) and underline.
84 |
85 | {::nomarkdown}
86 | {% include box.html type="start" title="Code: CSS" class="example" %}
87 | {:/}
88 |
89 | ~~~ css
90 | nav a:hover,
91 | nav a:focus {
92 | color: #036;
93 | background-color: #fff;
94 | text-decoration: underline;
95 | }
96 | ~~~
97 | {::nomarkdown}
98 | {% include box.html type="end" %}
99 | {:/}
100 |
101 | {% include ednote.html note="Find out how to display links to live examples." %}
102 |
103 | See this code in action in the [live example](#example).
104 |
105 | ### Active state
106 |
107 | Indicate the menu item that was activated through clicking, tapping, or keyboard selection. Users can identify unintended activation, for instance when they have clicked on the wrong menu item. In this example, the active item has a darker blue background and an underline.
108 |
109 | {::nomarkdown}
110 | {% include box.html type="start" title="Code: CSS" class="example" %}
111 | {:/}
112 |
113 | ~~~ css
114 | nav a:active {
115 | color: #fff;
116 | background-color: #024;
117 | text-decoration: underline;
118 | }
119 | ~~~
120 |
121 | {::nomarkdown}
122 | {% include box.html type="end" %}
123 | {:/}
124 |
125 | {% include ednote.html note="Find out how to display links to live examples." %}
126 |
127 | See this code in action in the [live example](#example).
128 |
129 | ### Current state
130 |
131 | Also visually indicate the current menu item in addition to the structural markup discussed in the previous section.
132 |
133 | In this example, a different color combination (black on gray) and a bottom border were added to give the current menu item a distinct color and shape.
134 |
135 | {::nomarkdown}
136 | {% include box.html type="start" title="Code: CSS" class="example" %}
137 | {:/}
138 |
139 | ~~~ css
140 | nav [aria-current=page] {
141 | background-color: #bbb;
142 | color: #000;
143 | border-bottom: .25em solid #444;
144 | }
145 | ~~~
146 |
147 | {::nomarkdown}
148 | {% include box.html type="end" %}
149 | {:/}
150 |
151 | {% include ednote.html note="Find out how to display links to live examples." %}
152 |
153 | See this code in action in the [live example](#example).
154 |
155 | ### Visited state
156 |
157 | For some types of menus, such as instructional steps, it may be useful to indicate menu items that a user had already visited. However, most menus are not expected to change based on the visited state.
158 |
159 | {::nomarkdown}
160 | {% include box.html type="start" title="Example" h=2 class="example large" id="example" %}
161 | {:/}
162 |
163 |
164 |
171 |
172 |
173 |
217 |
218 | {::nomarkdown}
219 | {% include box.html type="end" %}
220 | {:/}
221 |
--------------------------------------------------------------------------------
/content/page-structure/example.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Page Structure Code Example"
3 | nav_title: Code Example
4 | permalink: /tutorials/page-structure/example/
5 | ref: /tutorials/page-structure/example/
6 | lang: en
7 |
8 | github:
9 | branch: 'master-2.0'
10 | repository: w3c/wai-tutorials
11 | path: content/example.md
12 | metafooter: true
13 |
14 | resource:
15 | ref: /tutorials/page-structure/
16 |
17 | navigation:
18 | previous: /tutorials/page-structure/content/
19 |
20 | metafooter: true
21 | last_updated: 2017-04-20
22 | editors:
23 | - Eric Eggert: "https://www.w3.org/People/yatil/"
24 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
25 | update_editors:
26 | - Brian Elton
27 | contributing_participants:
28 | - see Acknowledgements
29 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
30 |
31 |
32 | ---
33 |
34 | {::nomarkdown}
35 | {% include box.html type="start" title="Code" class="example" %}
36 | {:/}
37 |
38 | ~~~html
39 | …
40 |
41 |
42 | Space Teddy Inc.
43 |
44 |
45 | Navigation Menu
46 | …
47 |
48 |
49 |
50 | An inside look at the new Space Teddy 6
51 |
52 |
53 | …
54 |
55 | …
56 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
57 | …
58 |
59 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
60 | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
61 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
62 |
63 | Cotton Fur
64 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
65 | …
66 |
74 |
75 |
83 |
84 |
85 | © SpaceTeddy Inc.
86 |
87 |
88 | …
89 | ~~~
90 |
91 | {::nomarkdown}
92 | {% include box.html type="end" %}
93 | {:/}
--------------------------------------------------------------------------------
/content/page-structure/headings.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Headings"
3 | permalink: /tutorials/page-structure/headings/
4 | ref: /tutorials/page-structure/headings/
5 | lang: en
6 | # translators: # Uncomment (remove #) for translations, one - name line per translator.
7 | # - name: Translator 1
8 | # - name: Translator 2
9 | # contributors:
10 | # - name: Contributor 1
11 | # - name: Contributor 2
12 | github:
13 | branch: 'master-2.0'
14 | repository: w3c/wai-tutorials
15 | path: content/headings.md
16 |
17 | resource:
18 | ref: /tutorials/page-structure/
19 |
20 | navigation:
21 | previous: /tutorials/page-structure/labels/
22 | next: /tutorials/page-structure/content/
23 |
24 | wcag_success_criteria:
25 | - 1.3.1
26 | - 2.4.1
27 | - 2.4.6
28 | - 2.4.10
29 | wcag_techniques:
30 | - H69
31 | - H80
32 | - PDF9
33 | - G130
34 | - G141
35 | - ARIA12
36 | - H42
37 |
38 | metafooter: true
39 | last_updated: 2017-05-04
40 | editors:
41 | - Eric Eggert: "https://www.w3.org/People/yatil/"
42 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
43 | update_editors:
44 | - Brian Elton
45 | contributing_participants:
46 | - see Acknowledgements
47 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
48 |
49 | ---
50 |
51 | {::nomarkdown}
52 | {% include box.html type="start" h="2" title="Overview" class="full" %}
53 | {:/}
54 |
55 | Headings communicate the organization of the content on the page. Web browsers, plug-ins, and assistive technologies can use them to provide in-page navigation.
56 |
57 | {::nomarkdown}
58 | {% include box.html type="end" %}
59 | {:/}
60 |
61 | {% include_cached toc.html %}
62 |
63 | ## Heading ranks
64 |
65 | Nest headings by their rank (or level). The most important heading has the rank 1 (``), the least important heading rank 6 (``). Headings with an equal or higher rank start a new section, headings with a lower rank start new subsections that are part of the higher ranked section.
66 |
67 | Skipping heading ranks can be confusing and should be avoided where possible: Make sure that a `` is **not** followed directly by an ``, for example. It is ok to skip ranks when closing subsections, for instance, a `` beginning a new section, can follow an `` as it closes the previous section.
68 |
69 | ### Exception for fixed page sections
70 |
71 | In fixed sections of the page, for example in sidebars, the heading ranks _should not_ change depending on the ranks in the content area. In those cases, consistency across pages is more important.
72 |
73 | ## Organize passages of text
74 |
75 | In the following example, headings are used to only organize passages of text on a page, for example the main content:
76 |
77 | {::nomarkdown}
78 | {% include box.html type="start" title="Example" class="example" %}
79 | {:/}
80 |
81 | {% include image.html src="page-structure/page-structure-headings-intro.png" srcset="page-structure/page-structure-headings-intro.png, page-structure/page-structure-headings-intro@2x.png 2x, page-structure/page-structure-headings-intro@3x.png 3x" alt="One example (h1) heading (Space Teddy) with three h2 headings inside the content (Cotton Fur, Sapphire Eyes, Synthetic Felt Paws)." class="" %}
82 |
83 | {::nomarkdown}
84 | {% include box.html type="end" %}
85 | {:/}
86 |
87 | ## Headings that reflect the page organization
88 |
89 | Headings are useful for labeling page regions. Use `aria-labelledby` to associate headings with their page region, as described in the [label page regions](/tutorials/page-structure/labels/#using-aria-labelledby) section of this tutorial. If the headings are visible, the regions are easy to identify for all users.
90 |
91 | ### Main heading before navigation
92 | {:.ex}
93 |
94 | In this first example, the heading with the rank 1 is the first heading in the document. All other headings for structuring the page (Navigation Menu, Sidebar, Footer) are one rank lower, and so is the heading for the main content.
95 |
96 | {::nomarkdown}
97 | {% include box.html type="start" title="Example" class="example" %}
98 | {:/}
99 |
100 | {% include image.html src="page-structure/page-structure-headings.png" srcset="page-structure/page-structure-headings.png, page-structure/page-structure-headings@2x.png 2x, page-structure/page-structure-headings@3x.png 3x" alt="One h1 heading with several h2s and h3 creating subsections. One subsection’s heading is ”(h3) Sapphire Eyes” which has a subsection “(h4) How they are made”. The next heading is an h2, indicating that the (h4) and (h3) subsections are both closed now." class="normal" %}
101 |
102 | {::nomarkdown}
103 | {% include box.html type="end" %}
104 | {:/}
105 |
106 | {% include ednote.html note="Figure out how to display links now that the sidebar is not available anymore." %}
107 |
108 | View a [complete code example](/tutorials/page-structure/example/) to see headings used like this.
109 |
110 | ### Main heading after navigation
111 | {:.ex}
112 |
113 | In this second example, the main heading is not the site name but the content heading, which is rank 1. The subheadings in the content are rank 2 as are all the other structural headings.
114 |
115 | {::nomarkdown}
116 | {% include box.html type="start" title="Example" class="example" %}
117 | {:/}
118 |
119 | {% include image.html src="page-structure/page-structure-headings-2.png" srcset="page-structure/page-structure-headings-2.png, page-structure/page-structure-headings-2@2x.png 2x, page-structure/page-structure-headings-2@3x.png 3x" alt="The page starts with an (h2) Navigation Menu, followed by an (h2) Sidebar and an (h1) Space Teddy. The following headings are all (h2) subsections, including the footer which – " class="normal" %}
120 |
121 | {::nomarkdown}
122 | {% include box.html type="end" %}
123 | {:/}
--------------------------------------------------------------------------------
/content/page-structure/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Page Structure Tutorial"
3 | permalink: /tutorials/page-structure/
4 | ref: /tutorials/page-structure/
5 | lang: en
6 |
7 | github:
8 | branch: 'master-2.0'
9 | repository: w3c/wai-tutorials
10 | path: content/index.md
11 |
12 | navigation:
13 | next: /tutorials/page-structure/regions/
14 |
15 | metafooter: true
16 | first_published: "April 2017"
17 | last_updated: 2018-04-27
18 | editors:
19 | - Eric Eggert: "https://www.w3.org/People/yatil/"
20 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
21 | update_editors:
22 | - Brian Elton
23 | contributing_participants:
24 | - see Acknowledgements
25 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
26 |
27 |
28 | wcag_success_criteria:
29 | - 1.3.1
30 | - 2.4.1
31 | - 2.4.6
32 | - 2.4.10
33 | ---
34 |
35 | Well-structured content allows more efficient navigation and processing. Use HTML and WAI-ARIA to improve navigation and orientation on web pages and in applications.
36 |
37 | * **[Page Regions](/tutorials/page-structure/regions/):** Identify and mark up regions on web pages using HTML5 and WAI-ARIA roles.
38 |
39 | * **[Labeling Regions](/tutorials/page-structure/labels/):** Label regions to allow users to distinguish and access them.
40 |
41 | * **[Headings](/tutorials/page-structure/headings/):** Add headings and nest them logically to label sections of web pages according to their relationships and importance.
42 |
43 | * **[Content Structure](/tutorials/page-structure/content/):** Mark up the content on a page in a way that uses appropriate and meaningful elements.
44 |
45 | ## Why is this important?
46 |
47 | Pages with well-structured content are essential for many web users, for example:
48 |
49 | * **People with cognitive and learning disabilities** can more easily find and prioritize content on the page.
50 | * **People using screen readers** can skip to the main content directly and navigate to sections that are important to them.
51 | * **Keyboard users** can browse pages and their sections more efficiently. Otherwise, users have to press the tab key multiple times to navigate through all links in each section.
52 | * **People using software that only shows the main content** of a web page, such as people with cognitive disabilities, will receive better results if the page structure is correctly marked up.
53 | * **People with visual impairments**, including people with low vision, have cues that provide orientation on the page and in the content.
54 | * **Mobile web users** often have access to a so-called “reader” or “reading” mode that will only show the main content of the page if it is correctly marked up.
55 | * **People using certain browser plugins** can use landmark roles to jump to specific sections on a page.
56 | * There are additional benefits to a good, accessible page structure, beyond those experienced by people with disabilities. As an example, search engines can use the data to better index the content of a page.
57 |
--------------------------------------------------------------------------------
/content/page-structure/labels.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Labeling Regions"
3 | permalink: /tutorials/page-structure/labels/
4 | ref: /tutorials/page-structure/labels/
5 | lang: en
6 |
7 | github:
8 | branch: 'master-2.0'
9 | repository: w3c/wai-tutorials
10 | path: content/labels.md
11 |
12 | resource:
13 | ref: /tutorials/page-structure/
14 |
15 | navigation:
16 | previous: /tutorials/page-structure/regions/
17 | next: /tutorials/page-structure/headings/
18 |
19 | wcag_success_criteria:
20 | - 2.4.1
21 | - 2.4.6
22 | wcag_techniques:
23 | - H69
24 | - ARIA11
25 |
26 | metafooter: true
27 | last_updated: 2017-04-21
28 | editors:
29 | - Eric Eggert: "https://www.w3.org/People/yatil/"
30 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
31 | update_editors:
32 | - Brian Elton
33 | contributing_participants:
34 | - see Acknowledgements
35 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
36 | ---
37 |
38 | {::nomarkdown}
39 | {% include box.html type="start" h="2" title="Overview" class="full" %}
40 | {:/}
41 |
42 | Provide labels to distinguish two page regions of the same type, such as “main navigation” and “sub-navigation” menus using a `` element on the same page. Labels are also used to change the default identification of page regions, for example, to identify a `` region as “advertisement”. Regions that are unique, such as ``, do not need additional labels.
43 |
44 | {::nomarkdown}
45 | {% include box.html type="end" %}
46 | {:/}
47 |
48 | {% include_cached toc.html %}
49 |
50 | ## Using `aria-labelledby`
51 | {:.ap}
52 |
53 | Use `aria-labelledby` to point to an existing element by its (unique) `id`. The label of the region is the content of the referenced element. Every element can be a label this way. Labels should be short and descriptive. If a heading is present in the region, consider using it as the label:
54 |
55 | {::nomarkdown}
56 | {% include box.html type="start" title="Code Snippet" class="example" %}
57 | {:/}
58 |
59 | ~~~html
60 |
61 | On this Page
62 | …
63 |
64 | ~~~
65 |
66 | {::nomarkdown}
67 | {% include box.html type="end" %}
68 | {:/}
69 |
70 | {% include ednote.html note="Figure out how to display links now that the sidebar is not available anymore." %}
71 |
72 | Explore other WAI-ARIA resources:
73 |
74 | * [WAI-ARIA Overview](https://www.w3.org/WAI/intro/aria)
75 | * [Notes on Using ARIA in HTML](https://www.w3.org/TR/aria-in-html/)
76 |
77 | Note: This approach using headings is also backward compatible for older web browsers and assistive technologies do not process HTML5 and WAI-ARIA.
78 |
79 | View a [complete code example](/tutorials/page-structure/example/) with regions and labels.
80 |
81 | ## Using `aria-label`
82 | {:.ap}
83 |
84 | Use the WAI-ARIA `aria-label` attribute to label the region. Consider this approach if the label should not appear visually on the page.
85 |
86 | {::nomarkdown}
87 | {% include box.html type="start" title="Code Snippet" class="example" %}
88 | {:/}
89 |
90 | ~~~html
91 |
92 | …
93 |
94 | ~~~
95 |
96 | {::nomarkdown}
97 | {% include box.html type="end" %}
98 | {:/}
99 |
100 | {% include ednote.html note="Figure out how to display links now that the sidebar is not available anymore." %}
101 |
102 |
--------------------------------------------------------------------------------
/content/tables/examples/headertoprow.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Complete “Table with header cells in the top row only” Example
3 | lang: en
4 | permalink: /tutorials/tables/examples/headertoprow/
5 | ref: /tutorials/tables/examples/headertoprow/
6 | ---
7 |
8 | [Back to page](/tutorials/tables/one-header/)
9 |
10 | ~~~ html
11 |
12 |
13 |
14 | Date
15 | Event
16 | Venue
17 |
18 |
19 | 12 Feb
20 | Waltz with Strauss
21 | Main Hall
22 |
23 |
24 | 24 Mar
25 | The Obelisks
26 | West Wing
27 |
28 |
29 | 14 Apr
30 | The What
31 | Main Hall
32 |
33 |
34 |
35 | ~~~
36 |
--------------------------------------------------------------------------------
/content/tables/examples/headertoprowfirstcol.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Complete “Table with header cells in the top row only” Example
3 | lang: en
4 | permalink: /tutorials/tables/examples/headertoprowfirstcol/
5 | ref: /tutorials/tables/examples/headertoprowfirstcol/
6 | ---
7 |
8 | [Back to page](/tutorials/tables/two-headers/#table-with-header-cells-in-the-top-row-and-first-column)
9 |
10 | ~~~ html
11 |
12 |
13 |
14 |
15 | Monday
16 | Tuesday
17 | Wednesday
18 | Thursday
19 | Friday
20 |
21 |
22 | 09:00 – 11:00
23 | Closed
24 | Open
25 | Open
26 | Closed
27 | Closed
28 |
29 |
30 | 11:00 – 13:00
31 | Open
32 | Open
33 | Closed
34 | Closed
35 | Closed
36 |
37 |
38 | 13:00 – 15:00
39 | Open
40 | Open
41 | Open
42 | Closed
43 | Closed
44 |
45 |
46 | 15:00 – 17:00
47 | Closed
48 | Closed
49 | Closed
50 | Open
51 | Open
52 |
53 |
54 |
55 | ~~~
56 |
--------------------------------------------------------------------------------
/content/tables/examples/multiplecolumnheaders.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Complete “Table with multiple column headers in each column” Example
3 | lang: en
4 | permalink: /tutorials/tables/examples/multiplecolumnheaders/
5 | ref: /tutorials/tables/examples/multiplecolumnheaders/
6 | ---
7 |
8 | [Back to page](/tutorials/tables/multi-level/#table-with-multiple-column-headers-in-each-column)
9 |
10 | ~~~ html
11 |
12 |
13 |
14 | Supplier contacts
15 |
16 |
17 |
18 | Example 1 Ltd
19 | Example 2 Co
20 |
21 |
22 | Contact
23 | James Phillips
24 | Marie Beauchamp
25 |
26 |
27 | Position
28 | Sales Director
29 | Sales Manager
30 |
31 |
32 | Email
33 | jp@1ltd.example.com
34 | marie@2co.example.com
35 |
36 |
37 |
38 | Example 3 Ltd
39 | Example 4 Inc
40 |
41 |
42 | Contact
43 | Suzette Jones
44 | Alex Howe
45 |
46 |
47 | Position
48 | Sales Officer
49 | Sales Director
50 |
51 |
52 | Email
53 | Suz@ltd3.example.com
54 | howe@4inc.example.com
55 |
56 |
57 |
58 | ~~~
59 |
--------------------------------------------------------------------------------
/content/tables/examples/scope-multiple.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Complete “Table with headers spanning multiple rows or columns” Example
3 | lang: en
4 | permalink: /tutorials/tables/examples/scope-multiple/
5 | ref: /tutorials/tables/examples/scope-multiple/
6 | ---
7 |
8 | [Back to page](/tutorials/tables/irregular/#table-with-headers-spanning-multiple-rows-or-columns)
9 |
10 | ~~~ html
11 |
12 |
13 |
14 | Poster availability
15 |
16 |
17 | Poster name
18 | Color
19 | Sizes available
20 |
21 |
22 | Zodiac
23 | Full color
24 | A2
25 | A3
26 | A4
27 |
28 |
29 | Black and white
30 | A1
31 | A2
32 | A3
33 |
34 |
35 | Sepia
36 | A3
37 | A4
38 | A5
39 |
40 |
41 | Angels
42 | Black and white
43 | A1
44 | A3
45 | A4
46 |
47 |
48 | Sepia
49 | A2
50 | A3
51 | A5
52 |
53 |
54 |
55 | ~~~
56 |
--------------------------------------------------------------------------------
/content/tables/examples/scope-offset.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Complete “Table with an offset column of header cells” Example
3 | lang: en
4 | permalink: /tutorials/tables/examples/scope-offset/
5 | ref: /tutorials/tables/examples/scope-offset/
6 | ---
7 |
8 | [Back to page](/tutorials/tables/two-headers/#table-with-an-offset-column-of-header-cells)
9 |
10 | ~~~ html
11 |
12 |
13 |
14 | Holidays taken in the last six months
15 |
16 |
17 |
18 | ID
19 | Name
20 | July
21 | August
22 | September
23 | October
24 | November
25 | December
26 |
27 |
28 |
29 |
30 |
31 | 215
32 | Abel
33 | 5
34 | 2
35 | 0
36 | 0
37 | 0
38 | 3
39 |
40 |
41 |
42 | 231
43 | Annette
44 | 0
45 | 5
46 | 3
47 | 0
48 | 0
49 | 6
50 |
51 |
52 |
53 | 173
54 | Bernard
55 | 2
56 | 0
57 | 0
58 | 5
59 | 0
60 | 0
61 |
62 |
63 |
64 | 141
65 | Gerald
66 | 0
67 | 10
68 | 0
69 | 0
70 | 0
71 | 8
72 |
73 |
74 |
75 | 99
76 | Michael
77 | 8
78 | 8
79 | 8
80 | 8
81 | 0
82 | 4
83 |
84 |
85 |
86 |
87 | ~~~
88 |
--------------------------------------------------------------------------------
/content/tables/examples/scope-simple.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Complete “Table with header cells in one column only” Example
3 | lang: en
4 | permalink: /tutorials/tables/examples/scope-simple/
5 | ref: /tutorials/tables/examples/scope-simple/
6 | ---
7 |
8 | [Back to page](/tutorials/tables/irregular/)
9 |
10 | ~~~ html
11 |
12 |
13 |
14 | Capital cities
15 |
16 |
17 | Country
18 | Capital city
19 |
20 |
21 | Belgium
22 | Brussels
23 |
24 |
25 | France
26 | Paris
27 |
28 |
29 | Holland
30 | Amsterdam
31 |
32 |
33 | Luxembourg
34 | Luxembourg
35 |
36 |
37 | Spain
38 | Madrid
39 |
40 |
41 | UK
42 | London
43 |
44 |
45 |
46 | ~~~
47 |
--------------------------------------------------------------------------------
/content/tables/examples/threeheaders.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Complete “Table with three headers related to each data cell” Example
3 | lang: en
4 | permalink: /tutorials/tables/examples/threeheaders/
5 | ref: /tutorials/tables/examples/threeheaders/
6 | ---
7 |
8 | [Back to page](/tutorials/tables/multi-level/#table-with-three-headers-related-to-each-data-cell)
9 |
10 | ~~~ html
11 |
12 |
13 |
14 | Availability of holiday accommodation
15 |
16 |
17 |
18 |
19 |
20 | Studio
21 |
22 |
23 | Apt
24 |
25 |
26 | Chalet
27 |
28 |
29 | Villa
30 |
31 |
32 |
33 |
34 |
35 |
36 | Paris
37 |
38 |
39 |
40 |
41 | 1 bedroom
42 |
43 |
44 | 11
45 |
46 |
47 | 20
48 |
49 |
50 | 25
51 |
52 |
53 | 23
54 |
55 |
56 |
57 |
58 | 2 bedroom
59 |
60 |
61 | -
62 |
63 |
64 | 43
65 |
66 |
67 | 52
68 |
69 |
70 | 32
71 |
72 |
73 |
74 |
75 | 3 bedroom
76 |
77 |
78 | -
79 |
80 |
81 | 13
82 |
83 |
84 | 15
85 |
86 |
87 | 40
88 |
89 |
90 |
91 |
92 | Rome
93 |
94 |
95 |
96 |
97 | 1 bedroom
98 |
99 |
100 | 13
101 |
102 |
103 | 21
104 |
105 |
106 | 22
107 |
108 |
109 | 3
110 |
111 |
112 |
113 |
114 | 2 bedroom
115 |
116 |
117 | -
118 |
119 |
120 | 23
121 |
122 |
123 | 43
124 |
125 |
126 | 30
127 |
128 |
129 |
130 |
131 | 3 bedroom
132 |
133 |
134 | -
135 |
136 |
137 | 16
138 |
139 |
140 | 32
141 |
142 |
143 | 40
144 |
145 |
146 |
147 |
148 |
149 | ~~~
150 |
--------------------------------------------------------------------------------
/content/tables/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Tables Tutorial"
3 | permalink: /tutorials/tables/
4 | ref: /tutorials/tables/
5 | lang: en
6 |
7 | description:
8 | image: /content-images/wai-tutorials/tables/social.png
9 | github:
10 | branch: 'master-2.0'
11 | repository: w3c/wai-tutorials
12 | path: 'content/tables/index.md'
13 |
14 | resource_title: Tables Tutorial
15 |
16 | metafooter: true
17 | last_updated: 2023-02-16
18 | editors:
19 | - Eric Eggert: "https://www.w3.org/People/yatil/"
20 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
21 | update_editors:
22 | - Brian Elton
23 | contributing_participants:
24 | - see Acknowledgements
25 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
26 |
27 |
28 | resource:
29 | ref: /tutorials/
30 | navigation:
31 | next: /tutorials/tables/one-header/
32 |
33 | wcag_success_criteria:
34 | - 1.3.1
35 | ---
36 |
37 | Data tables are used to organize data with a logical relationship in grids. Accessible tables need HTML markup that indicates header cells and data cells and defines their relationship. Assistive technologies use this information to provide context to users.
38 |
39 | Header cells must be marked up with ``, and data cells with ` ` to make tables accessible. For more complex tables, explicit associations may be needed using `scope`, `id`, and `headers` attributes.
40 |
41 | This tutorial shows you how to apply appropriate structural markup to tables. It includes the following pages:
42 |
43 | {% include ednote.html note="Images need to be adapted to new icon styles eventually" %}
44 |
45 | - {:.left} **[Tables with one header{% include image.html src="tables/img-simple.png" class="small" %}](/tutorials/tables/one-header/)** for rows or columns: For tables with content that is easy to distinguish, mark up header cells with ` ` and data cells with ` ` elements.
46 |
47 | - {:.left} **[Tables with two headers{% include image.html src="tables/img-multidir.png" class="small" %}](/tutorials/tables/two-headers/)** have a simple row header and a simple column header: For tables with unclear header directions, define the direction of each header by setting the `scope` attribute to `col` or `row`.
48 |
49 | - {:.left} **[Tables with irregular headers{% include image.html src="tables/img-irreg.png" class="small" %}](/tutorials/tables/irregular/)** have header cells that span multiple columns and/or rows: For these tables, define column and row groups and set the range of the header cells using the `colgroup` and `rowgroup` values of the scope attribute.
50 |
51 | - {:.left} **[Tables with multi-level headers{% include image.html src="tables/img-multi.png" class="small" %}](/tutorials/tables/multi-level/)** have multiple header cells associated per data cell: For tables that are so complex that header cells can’t be associated in a strictly horizontal or vertical way, use `id` and `headers` attributes to associate header and data cells explicitly.
52 |
53 | - {:.left} **[Caption & Summary{% include image.html src="tables/img-caption.png" class="small" %}](/tutorials/tables/caption-summary/):** A caption identifies the overall topic of a table and is useful in most situations. A summary provides orientation or navigation hints in complex tables.
54 | {:.nolist.withicons style="--img-width: 120px"}
55 |
56 | Some document formats other than HTML, such as PDF, provide similar mechanisms to markup table structures. Word processing applications may also provide mechanisms to markup tables. Tables markup is often lost when converting from one format to another, though some programs may provide functionality to assist converting table markup.
57 |
58 | Many web authoring tools and content management systems (CMS) provide functions to define header cells during table creation without having to edit the code manually.
59 |
60 | {::nomarkdown}
61 | {% include box.html type="start" title="Note" class="simple notes" %}
62 | {:/}
63 |
64 | This tutorial provides guidance for creating tables used to display data in a grid. This tutorial does not apply to tables used for layout. As a general rule, tables aren't meant to be used for layout purposes. Instead, a best practice is to use Cascading Style Sheets (CSS) for visual presentation.
65 |
66 | {::nomarkdown}
67 | {% include box.html type="end" %}
68 | {:/}
69 |
70 | ## Why is this important?
71 |
72 | Tables without structural markup to differentiate and properly link between header and data cells, create accessibility barriers. Relying on visual cues alone is not sufficient to create an accessible table. With structural markup, headers and data cells can be programmatically determined by software, which means that:
73 |
74 | - **People using screen readers** can have the row and column headers read aloud as they navigate through the table. Screen readers speak one cell at a time and reference the associated header cells, so the reader doesn’t lose context.
75 |
76 | - **Some people use alternative ways to render the data**, for example by using custom stylesheets to display header cells more prominently. Techniques like this enable them to change text size and colors and display the information as lists rather than grids. The table code needs to be properly structured to allow alternative renderings.
77 |
--------------------------------------------------------------------------------
/content/tables/one-header.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Tables with One Header"
3 | nav_title: One Header
4 | permalink: /tutorials/tables/one-header/
5 | ref: /tutorials/tables/one-header/
6 | lang: en
7 |
8 | description:
9 | image: /content-images/wai-tutorials/tables/social.png
10 | github:
11 | branch: 'master-2.0'
12 | repository: w3c/wai-tutorials
13 | path: 'content/tables/one-header.md'
14 |
15 | resource:
16 | ref: /tutorials/tables/
17 | navigation:
18 | previous: /tutorials/tables/
19 | next: /tutorials/tables/two-headers/
20 |
21 | wcag_techniques:
22 | - H51
23 | - H63
24 |
25 | metafooter: true
26 | last_updated: 2019-07-27
27 | editors:
28 | - Eric Eggert: "https://www.w3.org/People/yatil/"
29 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
30 | update_editors:
31 | - Brian Elton
32 | contributing_participants:
33 | - see Acknowledgements
34 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
35 |
36 | ---
37 |
38 | {::nomarkdown}
39 | {% include box.html type="start" h="2" title="Overview" class="full" %}
40 | {:/}
41 |
42 | {% include image.html src="tables/img-simple.png" class="small right" %} This page covers tables that have one simple header for rows or one simple header for columns. Data in such tables is descriptive on its own and unambiguous.
43 |
44 | {::nomarkdown}
45 | {% include box.html type="end" %}
46 | {:/}
47 |
48 | {% include_cached toc.html %}
49 |
50 | If the table content is ambiguous or has both column and row headings, the `scope` attribute should be used to avoid confusion. For more guidance on such tables, see [tables with two headers](/tutorials/two-headers/).
51 |
52 | ## Table with header cells in the top row only
53 | {:.ex}
54 |
55 | The following table of concerts has the cells in the first row marked up using the ` ` element. This is only acceptable because it is such a small table and the data itself is distinctly different in each column so that the relationship between the header and data cells is evident.
56 |
57 | {::nomarkdown}
58 | {% include box.html type="start" title="Note" class="simple notes" %}
59 | {:/}
60 |
61 | {% include ednote.html note="Remove Note: Use of Scope for Simple Data Tables Is Unnecessary" issue="576" repo="wai-tutorials" status="open" %}
62 |
63 | Some screen readers will read “Date – Event – Venue” in the “Venue” cell because the direction of the ` ` elements is ambiguous.
64 |
65 | {::nomarkdown}
66 | {% include box.html type="end" %}
67 | {:/}
68 |
69 | {::nomarkdown}
70 | {% include box.html type="start" title="Example" class="example" %}
71 |
72 | Concerts:
73 |
74 |
75 | Date
76 | Event
77 | Venue
78 |
79 |
80 | 12 February
81 | Waltz with Strauss
82 | Main Hall
83 |
84 |
85 | 24 March
86 | The Obelisks
87 | West Wing
88 |
89 |
90 | 14 April
91 | The What
92 | Main Hall
93 |
94 |
95 |
96 | {% include box.html type="end" %}
97 | {:/}
98 |
99 | {::nomarkdown}
100 | {% include box.html type="start" title="Code Snippet" class="example" %}
101 | {:/}
102 |
103 | ~~~ html
104 |
105 |
106 | Date
107 | Event
108 | Venue
109 |
110 |
111 | 12 February
112 | Waltz with Strauss
113 | Main Hall
114 |
115 | […]
116 |
117 | ~~~
118 |
119 | {::nomarkdown}
120 | {% include box.html type="end" %}
121 | {:/}
122 |
123 | ## Table with header cells in the first column only
124 | {:.ex}
125 |
126 | In the following table, the data from the previous example is laid out with the header column on the left. Also in this situation, it is only acceptable to use this code because it is such a small and straightforward table. The next pages in this tutorial explain how to code more complex tables.
127 |
128 | {::nomarkdown}
129 | {% include box.html type="start" title="Example" class="example" %}
130 |
131 | Concerts:
132 |
133 |
134 | Date
135 | 12 February
136 | 24 March
137 | 14 April
138 |
139 |
140 | Event
141 | Waltz with Strauss
142 | The Obelisks
143 | The What
144 |
145 |
146 | Venue
147 | Main Hall
148 | West Wing
149 | Main Hall
150 |
151 |
152 |
153 | {% include box.html type="end" %}
154 | {:/}
155 |
156 | {::nomarkdown}
157 | {% include box.html type="start" title="Code Snippet" class="example" %}
158 | {:/}
159 |
160 | ~~~ html
161 |
162 |
163 | Date
164 | 12 February
165 | 24 March
166 | 14 April
167 |
168 |
169 | Event
170 | Waltz with Strauss
171 | The Obelisks
172 | The What
173 |
174 |
175 | Venue
176 | Main Hall
177 | West Wing
178 | Main Hall
179 |
180 |
181 | ~~~
182 |
183 | {::nomarkdown}
184 | {% include box.html type="end" %}
185 | {:/}
186 |
187 | ## Table with ambiguous data
188 | {:.ex}
189 |
190 | {% include ednote.html note="Remove Example: Use of Scope for Simple Data Tables Is Unnecessary" issue="576" repo="wai-tutorials" status="open" %}
191 |
192 | In this example, the data (first name, last name, and city) can’t be distinguished from one another without knowing which header each corresponds to. The `scope` attribute with the value `col` defines the direction of the header cells and associates them with the corresponding data cells. The `scope` attribute is also needed for larger tables with one header row or column.
193 |
194 | {::nomarkdown}
195 | {% include box.html type="start" title="Example" class="example" %}
196 |
197 | Teddy bear collectors:
198 |
199 | Last Name
200 | First Name
201 | City
202 |
203 |
204 | Phoenix
205 | Imari
206 | Henry
207 |
208 |
209 | Zeki
210 | Rome
211 | Min
212 |
213 |
214 | Apirka
215 | Kelly
216 | Brynn
217 |
218 |
219 |
220 | {% include box.html type="end" %}
221 | {:/}
222 |
223 | {::nomarkdown}
224 | {% include box.html type="start" title="Code Snippet" class="example" %}
225 | {:/}
226 |
227 | ~~~ html
228 |
229 | Teddy bear collectors:
230 |
231 | Last Name
232 | First Name
233 | City
234 |
235 |
236 | Phoenix
237 | Imari
238 | Henry
239 |
240 |
241 | Zeki
242 | Rome
243 | Min
244 |
245 |
246 | Apirka
247 | Kelly
248 | Brynn
249 |
250 |
251 | ~~~
252 |
253 | {::nomarkdown}
254 | {% include box.html type="end" %}
255 | {:/}
256 |
--------------------------------------------------------------------------------
/content/tables/tips.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Tips and Tricks"
3 | permalink: /tutorials/tables/tips/
4 | ref: /tutorials/tables/tips/
5 | lang: en
6 |
7 | description:
8 | image: /content-images/wai-tutorials/tables/social.png
9 | github:
10 | branch: 'master-2.0'
11 | repository: w3c/wai-tutorials
12 | path: 'content/tables/tips.md'
13 |
14 | resource:
15 | ref: /tutorials/tables/
16 | navigation:
17 | previous: /tutorials/tables/caption-summary/
18 |
19 | metafooter: true
20 | last_updated: 2024-05-13
21 | editors:
22 | - Eric Eggert: "https://www.w3.org/People/yatil/"
23 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
24 | update_editors:
25 | - Brian Elton
26 | contributing_participants:
27 | - see Acknowledgements
28 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
29 |
30 | ---
31 |
32 | - **Keep it simple:** Complex tables are more work for content creators as well as being harder to interpret for users. It’s usually better to [break up complex tables into simple individual tables](/tutorials/tables/multi-level/#split-up-multi-level-tables), each containing the data for one sub-topic.
33 |
34 | - **Responsive design:** On small screens, in a small viewport, in zoomed views, with enlarged text, and other situations, responsive tables often change format. Ensure that the structural relationship is available in all formats.
35 |
36 | - **Table separation:** If several tables follow one another, don’t use a single table and put in an additional row of ` ` cells. Screen readers may read aloud all ` ` cells in a column, resulting in confusion. [Start a new `` when the topic changes.](/tutorials/tables/multi-level/#split-up-multi-level-tables)
37 |
38 | - **Data separation:**
39 |
40 | - Make sure that each separate piece of data has its cell. Don’t use headers in one column and all data in a second column, as this will make it almost impossible for screen readers to work out the relationships between data across columns.
41 |
42 | {% include image.html src="tables/headers-in-one-column-all-data-in-second.png" alt="On the left, a table with two columns is shown. The header for the first column reads “Shirt” and the header for the second column reads “Sizes and amount in stock”. The second row reads “Blue” in the first column and “S: 6; M: 13, XL: 10”. In the second row, Sizes for a “Red” shirt are “M: 2; L: 9; XL: 10; XXL: 1”. On the right, the table is split up in “Shirt”, “Size” and “Stock” columns." class="" %}
43 |
44 | - Don't use line breaks (` ` elements) to create table rows as the data in the pseudo-rows may no longer align correctly when text is resized.
45 |
46 | {% include image.html src="tables/table-text-resize.png" alt="On the top there is a table where the content and header cells are not marked up correctly. Line breaks are used to make items look like they align correctly. When resizing the text (bottom) the items don’t line up anymore" class="" %}
47 |
48 | - **Alignment:** Align text to the left and numeric data to the right (in left-to-right languages), so that people using larger text sizes or smaller screens will be able to find it. This is especially useful if a cell spans more than one column. It’s helpful to give column headers the same alignment as the data in the cells below.
49 |
50 | - **Styling header cells:** `` elements are used for header cells, using ` ` elements with different styling will make tables less accessible if not inaccessible. It is also helpful to differentiate ` ` and ` ` cells visually. For example, on these tutorial pages, header cells have a dark gray background.
51 |
52 | - **Zebra tables:** Styling even and odd rows in a different way can be helpful to people who have reading difficulties or who enlarge text. It acts as a visual guide. Highlighting the cell (and row/column) on mouseover and keyboard focus to support people to see where they are. Make sure that the contrast ratio between the text and background is good for both headers and data cells. [Here is how to check the contrast ratio.](https://www.w3.org/WAI/eval/preliminary#contrast)
53 |
54 | - **Flexibility:** Due to the layout model of tables, they sometimes don’t fit on small screens small or are too wide if the user is zooming in. In such circumstances, it’s important that the table isn’t cut off (for example by using `overflow: hidden` in CSS). In these tutorials `overflow: scroll` is applied to an element wrapping the table so users can scroll through the table horizontally but there are much more options to display table in such circumstances.
55 |
56 | - **Tables for Layout:** Tables should not be used for layout purposes. Use Cascading Style Sheets (CSS) for layout. If there are already layout tables present, don’t use structural elements (like ` ` or ``) and attributes discussed in this tutorial, and do add `role="presentation"` to the `` element.
57 |
58 | ## Other W3C Resources
59 |
60 | - [Content can be presented in different ways](https://www.w3.org/WAI/intro/people-use-web/principles#adaptable) section of Accessibility Principles in How People with Disabilities Use the Web.
61 |
--------------------------------------------------------------------------------
/content/tables/two-headers.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Tables with Two Headers"
3 | nav_title: Two Header
4 | permalink: /tutorials/tables/two-headers/
5 | ref: /tutorials/tables/two-headers/
6 | lang: en
7 |
8 | description:
9 | image: /content-images/wai-tutorials/tables/social.png
10 | github:
11 | branch: 'master-2.0'
12 | repository: w3c/wai-tutorials
13 | path: 'content/tables/two-headers.md'
14 |
15 | resource:
16 | ref: /tutorials/tables/
17 | navigation:
18 | previous: /tutorials/tables/one-header/
19 | next: /tutorials/tables/irregular/
20 |
21 | wcag_techniques:
22 | - H51
23 | - H63
24 |
25 | metafooter: true
26 | last_updated: 2019-07-27
27 | editors:
28 | - Eric Eggert: "https://www.w3.org/People/yatil/"
29 | - Shadi Abou-Zahra: "https://www.w3.org/People/shadi/"
30 | update_editors:
31 | - Brian Elton
32 | contributing_participants:
33 | - see Acknowledgements
34 | support: Developed by the Education and Outreach Working Group (EOWG ). Developed with support from the WAI-ACT project , co-funded by the European Commission IST Programme .
35 |
36 | ---
37 |
38 | {::nomarkdown}
39 | {% include box.html type="start" h="2" title="Overview" class="full" %}
40 | {:/}
41 |
42 | {% include image.html src="tables/img-multidir.png" class="small right" %} This page covers tables that have a simple row header and a simple column header. In such tables, the relationship between the headers and data cells becomes quickly ambiguous. For such tables, use the `` element to identify the header cells and the `scope` attribute to declare the direction of each header. The `scope` attribute can be set to `row` or `col` to denote that a header applies to the entire row or column, respectively.
43 |
44 | {::nomarkdown}
45 | {% include box.html type="end" %}
46 | {:/}
47 |
48 | {% include_cached toc.html %}
49 |
50 | Additionally, you can use the `` element to identify the table in a document. This is particularly useful for screen-reader users browsing the web page in “table mode” where they can navigate from table to table. More background and guidance on the using `` element is provided on the [Caption & Summary page](/tutorials/tables/caption-summary/).
51 |
52 | ## Table with header cells in the top row and first column
53 | {:.ex}
54 |
55 | The following table of opening times has header information in both the top row and the first column. All header cells are marked up as `` cells with `scope` attributes added.
56 |
57 | In the header row, the `col` value for `scope` associates each header cell with the data cells in the column. In the header column, the `row` value associates the individual headers with their rows. Without this information, some users would not easily understand the relationship between header and data cells. In the example below, the “Open” and “Closed” labels are only useful if they can be assigned to a particular day and time.
58 |
59 | {::nomarkdown}
60 | {% include box.html type="start" title="Example" class="example" %}
61 |
62 |
63 | Delivery slots:
64 |
65 |
66 | Monday
67 | Tuesday
68 | Wednesday
69 | Thursday
70 | Friday
71 |
72 |
73 | 09:00 – 11:00
74 | Closed
75 | Open
76 | Open
77 | Closed
78 | Closed
79 |
80 |
81 | 11:00 – 13:00
82 | Open
83 | Open
84 | Closed
85 | Closed
86 | Closed
87 |
88 |
89 | 13:00 – 15:00
90 | Open
91 | Open
92 | Open
93 | Closed
94 | Closed
95 |
96 |
97 | 15:00 – 17:00
98 | Closed
99 | Closed
100 | Closed
101 | Open
102 | Open
103 |
104 |
105 |
106 | {% include box.html type="end" %}
107 | {:/}
108 |
109 | {::nomarkdown}
110 | {% include box.html type="start" title="Code Snippet" class="example" %}
111 | {:/}
112 |
113 | ~~~ html
114 |
115 | Delivery slots:
116 |
117 |
118 | Monday
119 | Tuesday
120 | Wednesday
121 | Thursday
122 | Friday
123 |
124 |
125 | 09:00 – 11:00
126 | Closed
127 | Open
128 | Open
129 | Closed
130 | Closed
131 |
132 |
133 | 11:00 – 13:00
134 | Open
135 | Open
136 | Closed
137 | Closed
138 | Closed
139 |
140 | […]
141 |
142 | ~~~
143 |
144 | {::nomarkdown}
145 | {% include box.html type="end" %}
146 | {:/}
147 |
148 | [Full code for “Table with header cells in the top row and first column”](/tutorials/tables/examples/headertoprowfirstcol/)
149 |
150 | ## Table with an offset column of header cells
151 | {:.ex}
152 |
153 | In this table, the row header cells are in the second rather than in the first column. The approach is similar to the examples above: The scope of the header cells in the top row is set to `col`. By using the `row` value for `scope` assigns the header cells in the second column to the data cells on the left and the right of the individual header cell.
154 |
155 | {::nomarkdown}
156 | {% include box.html type="start" title="Example" class="example" %}
157 |
158 |
159 |
160 | Holidays taken in the last six months
161 |
162 |
163 |
164 | ID
165 | Name
166 | July
167 | August
168 | September
169 | October
170 | November
171 | December
172 |
173 |
174 |
175 |
176 |
177 | 215
178 | Abel
179 | 5
180 | 2
181 | 0
182 | 0
183 | 0
184 | 3
185 |
186 |
187 |
188 | 231
189 | Annette
190 | 0
191 | 5
192 | 3
193 | 0
194 | 0
195 | 6
196 |
197 |
198 |
199 | 173
200 | Bernard
201 | 2
202 | 0
203 | 0
204 | 5
205 | 0
206 | 0
207 |
208 |
209 |
210 | 141
211 | Gerald
212 | 0
213 | 10
214 | 0
215 | 0
216 | 0
217 | 8
218 |
219 |
220 |
221 | 99
222 | Michael
223 | 8
224 | 8
225 | 8
226 | 8
227 | 0
228 | 4
229 |
230 |
231 |
232 |
233 | {% include box.html type="end" %}
234 | {:/}
235 |
236 | {::nomarkdown}
237 | {% include box.html type="start" title="Code Snippet" class="example" %}
238 | {:/}
239 |
240 | ~~~ html
241 | […]
242 |
243 | 215
244 | Abel
245 | 5
246 | 2
247 | 0
248 | 0
249 | 0
250 | 3
251 |
252 | […]
253 | ~~~
254 |
255 | {::nomarkdown}
256 | {% include box.html type="end" %}
257 | {:/}
258 |
259 | [Full code for “Table with an offset column of header cells”](/tutorials/tables/examples/scope-offset/)
260 |
--------------------------------------------------------------------------------
/netlify.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | command = "git submodule update --init --remote && bundle exec jekyll build --config '_config.yml,_config_staging.yml'"
3 | publish = "_site"
4 |
5 | [build.environment]
6 | RUBY_VERSION = "3.3.3"
7 |
8 | [[redirects]]
9 | from = "/"
10 | to = "/tutorials"
11 |
12 | [dev]
13 | # NB on win64 (cmd or bash shells) --live reload is broken - s/-w --livereload/--no-watch
14 | # To run along side another WAI resource use the --port 3001 in the following and on CLI with `netify dev`
15 | command = "bundle exec jekyll serve -w --livereload --trace --config _config.yml,_config_staging.yml"
16 |
17 |
--------------------------------------------------------------------------------
/w3c.json:
--------------------------------------------------------------------------------
1 | {
2 | "group": 35532,
3 | "contacts": [
4 | "slhenry",
5 | "yatil"
6 | ],
7 | "shortName": "wai-tutorials",
8 | "repo-type": "article",
9 | "policy": "open"
10 | }
--------------------------------------------------------------------------------