--- url: "https://web.dev/learn/design/accessibility" titulek: "Accessibility | web.dev" h1: "Accessibility Stay organized with collections Save and categorize content based on your preferences." popis: "Ensure that your website is available to everyone." jazyk: "en" kanonicka: "https://web.dev/learn/design/accessibility" drobecky: ["web.dev", "Resources", "Responsive Design"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 00:02:50" znaku: 13291 slov: 1963 kodovani: "iso-8859-2" sha256: "f2f799ee604e4e03d0a10047ce023f912c3b7811cbb1160c06ab3e4e3b41a4df" --- Accessibility Stay organized with collections Save and categorize content based on your preferences. Allowing your pages to respond to different screen sizes is just one way of making sure your website is accessible to as many people as possible. Consider some of these other factors that you should keep in mind. Color vision deficiency Different people perceive color differently. People with protanopia don't perceive red as a distinct color. With deuteranopia, green is missing. For people with tritanopia, it's blue. Some tools can give you a general idea of how your color schemes appear to people with different kinds of color vision. [Firefox's Accessibility tab](https://developer.mozilla.org/docs/Tools/Accessibility_inspector/Simulation) includes a drop-down labeled **Simulate** with a list of options. Viewing a website with simulations of different kinds of color vision. In Chrome DevTools, the rendering tab lets you [emulate vision deficiencies](https://developer.chrome.com/blog/new-in-devtools-83#vision-deficiencies). Those are browser-specific tools. It's also possible to emulate different vision types at the operating system level. On the Mac, go to: System Preferences Accessibility Display Color Filters Enable Color Filters Select one of the options. In general it's not a good idea to rely purely on color to differentiate between different elements. For example, you can—and should—make your links a different color to the surrounding text. But you should also apply some other styling indicator like underlining the links or making them bold. Don't a { color: red; } Do a { color: red; font-weight: bold; } Color contrast Some color combinations can cause trouble. If there isn't enough contrast between the foreground color and background color, text becomes difficult to read. Poor color contrast is one of the most common accessibility issues on the web, but fortunately, it's one that you can catch early in the design process. Here are some tools you can use to test the contrast ratio of your text and background colors: [VisBug](https://github.com/GoogleChromeLabs/ProjectVisBug) is a browser extension available for all major desktop browsers. [Firefox's Accessibility Inspector](https://developer.mozilla.org/docs/Tools/Accessibility_inspector) can check for issues with visual contrast. You can also [discover and fix low-contrast text with Chrome DevTools](https://developers.google.com/codelabs/devtools-cvd). In Microsoft's Edge browser, you can [test text-color contrast using the color picker](https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/accessibility/color-picker). It's a good idea to always declare `color` and `background-color` together in your CSS. Don't assume that the background color will be the browser default. People can and do change the colors used by their browser. Don't body { color: black; } Do body { color: black; background-color: white; } High contrast Some people set their operating systems to use a high-contrast mode. You can try this on your operating system. On the Mac, go to: System Preferences Accessibility Display Select the option to increase contrast. There's a media feature to detect if someone has enabled high contrast mode. The [`prefers-contrast`](https://developer.mozilla.org/docs/Web/CSS/@media/prefers-contrast) media feature can be queried for three values: `no-preference`, `less`, and `more`. You can use this information to adjust your site's color palette. Browser Support 96 96 101 14.1 [Source](https://developer.mozilla.org/docs/Web/CSS/Reference/At-rules/@media/prefers-contrast) People can also set a preference in their operating system to use inverted colors. On the Mac, go to: System Preferences Accessibility Display Select the option to invert colors. Make sure your website still makes sense for someone browsing with inverted colors. Watch out for box shadows—these may need adjusting when colors are inverted. Font size Color isn't the only thing that people can adjust in their browser, they can also adjust the default font size. As their vision declines, they might adjust the default font size in their browsers or operating systems, bumping up the numbers with the passing of the years. You can respond to these settings by using relative font sizes. Avoid using units like `px`. Use relative units like `rem` or `ch` instead. Try changing the default text size setting in your browser. You can do that in your browser preferences. Or you can do it while you're visiting a web page by zooming in. Does your website still work if [the default font size is increased by 200%](https://www.w3.org/WAI/WCAG21/Understanding/resize-text.html)? How about 400%? Someone visiting your website on a desktop computer with their font size bumped up to 400% should get the same layout as someone visiting your site on a small-screen device. The same website viewed on a desktop device and a mobile device. The desktop browser's font size has been increased to 400%. Not everyone uses a mouse or a trackpad to navigate web pages. A keyboard is another way of getting around a page, with the `tab` key being particularly useful. Users can quickly move from one link or form field to the next. Links styled with the `:hover` and `:focus` [pseudo-classes,](/learn/css/pseudo-classes) will display those styles regardless of whether someone is using a mouse, a trackpad, or a keyboard. Use the `:focus-visible` [pseudo-class](/learn/css/pseudo-classes) to style your links for just keyboard navigation. You can make those styles extra noticeable. `a:focus, a:hover { outline: 1px dotted; } a:focus-visible { outline: 3px solid; }` As the user tabs from link to link or form field to form field, those elements will be focused in the order they appear in the document structure. This should also match the visual order. Be careful with the CSS `order` property. You can use this in combination with flexbox and grid to place elements in a different visual order to their order in the HTML. That's a powerful feature but it could confuse people navigating with a keyboard. Test your web pages by using the `tab` key on your keyboard to make sure that the tabbing order makes sense. In the **Accessibility** panel of the Firefox browser's developer tools there's an option to **Show Tabbing Order**. Enabling this will overlay numbers on each focusable element. Reduced motion Animation and motion are wonderful ways to bring web designs to life. But for some people these movements can be very disorienting and even cause nausea. There's a feature query that communicates whether the user would prefer less motion. It's called [`prefers-reduced-motion`](/articles/prefers-reduced-motion). Include it wherever you are using CSS transitions or animations. Browser Support 74 79 63 10.1 [Source](https://developer.mozilla.org/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion) `a:hover { transform: scale(150%); } @media (prefers-reduced-motion: no-preference) { a { transition-duration: 0.4s; transition-property: transform; } }` The `prefers-reduced-motion` media query is specifically for movement on the screen. If you are using transitions on an element's color that shouldn't be affected by `prefers-reduced-motion`. It's also OK to transition opacity and cross-fade. Reduced motion doesn't have to mean no animation. Voice People experience the web differently. Not everyone is seeing your website on a screen. Assistive technologies such as screen readers convert the information output to a screen into spoken words. Screen readers work with all kinds of applications including web browsers. In order for a web browser to communicate usefully with a screen reader, there needs to be useful semantic information in the web page being accessed. Previously, you learned how [icon-only buttons](/learn/design/icons) need to include an attribute to specify the button's purpose to non-sighted users. This is just one example of the importance of strong foundational HTML. Headings Use headings like `

`, `

`, `

`, etc. sensibly. Screen readers use these headings to generate an outline of your document which can be navigated with keyboard shortcuts. Don't
Welcome to my page
About me
My childhood
About this website
How this site was built
Do

Welcome to my page

About me

My childhood

About this website

How this site was built

Structure Use landmark elements like `
`, `