accessibility
It means people with disabilities can use the web. In details, they can perceive, navigate and interact with the website.
tab & hover
- how to find tab-focused element - David Walsh - focused element
use tabIndex
to enable focusable HTML elements
tabIndex
is a global attribute responsible for two things:
- it sets the order of "focusable" elements
- it makes elements "focusable"
use case
- To make your element focusable, use
tabindex="0"
- If don't want to make element to be focusable by tab, use
tabIndex="-1"
links
how to improve
- Do not make your pages dependent on images
- Make sure all your images have ALT text. Screen readers cannot "read images". In order for your images meaningful for people with disabilities, you need to add written descriptions for the images.
- Don't make the font size too small
- Use highly contrasting colors for your text and background.
- Screen reader friendly: use proper
aria
label, name and descriptions to navigate users to interact the page. - Use semantic markups, and then enhance with ARIA.
- add labels for form elements
- make sure you can navigate through a page using keyboard only
- create meaningful links
- etc.
To use accessibility API describe an object:
- role
- name
- state
Further readings:
- w3.org - Introduction to web accessibility
- w3.org - How people with disabilities use the web
- Smashing magazine - web accessibility with accessibility API
Online tools for checking your markup:
- web accessibility: how to make <a>
tag accessible?
HTML markup:
href
should presentname
id
if neededtextContent
make the text of
<a>
concise. so that when screen readers read the link, people with disabilities can understand it.- don't capitaliz link text. avoid using ASCII charactors, and using URLs as text.
- restrict numbers of links on a page
- always alert a user when opening a new tab/window. For example, add a new icon "external-link" so that screen readers can read it to people.
- to be continued