Accessibility Meaning Explained – How to Create Accessible Web Applications
Accessibility means allowing everyone access to a specific resource regardless of a person’s abilities or limitations.
In other words, an accessible web application has a universal design that makes it usable to everyone, irrespective of the user’s ability barriers.
The video below shows how web accessibility benefits everyone.
The Web is fundamentally designed to work for all people, whatever their hardware, software, language, location, or ability. When the Web meets this goal, it is accessible to people with a diverse range of hearing, movement, sight, and cognitive ability.
—W3C
Types of Limited Abilities
Below are some types of limited abilities a person may have.
- Permanent limitations: Lifelong constraints that limit a user’s ability to use a facility—for example, complete blindness or deafness.
- Temporary limitations: Short-term constraints that prevent a user from using a specific resource as usual—for instance, a broken arm or impairments after surgery.
- Situational limitations: Incidental constraints that make it difficult to use a facility—for example, slow internet, malfunctioning keyboard, or low mouse battery.
How to Use HTML to Create an Accessible Web App
Below are a few ways to use HTML to create accessible web content.
1. Use semantic HTML
Semantic HTML means expressing the meaning of an HTML element by using the correct tags to annotate the content.
For instance, although you can use any HTML element (such as <span>
or <div>
) to create a button.
However, it is best to use the <button>
tag because you get access to useful built-in features such as keyboard accessibility.
2. Use clear language
A clear language is a text that is easy to understand.
For instance, writing A–Z falsely assumes everyone knows what the dash (–
) symbol implies.
An accessible language conveys information explicitly.
3. Use accessible labels
Accessible labels are texts that are meaningful on their own and as part of the context in which you’ve used them.
For instance, consider the following link:
The link above is an inaccessible label because the text “here” is not meaningful on its own (where exactly is “here”?). Screen reader users will find multiple instances of “here”, “here”, “here” text labels problematic.
Here is a better alternative:
The link above is an accessible text label because the text “Visit CodeSweetly” is distinctive and meaningful out of context for all users. Screen readers will announce the text as “Visit CodeSweetly, link.”
4. Provide alt
attributes for images
An alt
attribute means “alternate text”. We use it to provide helpful descriptions of an image. Screen readers read out the alt
text to inform their users what the image means.
Suppose you do not provide an alt
attribute. In that case, screen readers will read out the image’s filename instead—which is not always helpful, especially if it’s a machine-generated filename.
An accessible image describes the image briefly and concisely.
How to Use CSS to Create an Accessible Web App
Below are a few ways to use CSS to create accessible web content.
1. Use accessible color contrast
Make sure your foreground and background colors have a high contrast ratio.
WebAIM’s Contrast Checker is an excellent tool for checking the contrast ratio between your foreground and background color.
Note the following:
4.5:1
is the minimum (level AA) requirement for normal text.3:1
is the minimum (level AA) requirement for large text.7:1
is the enhanced (level AAA) requirement for normal text.4.5:1
is the enhanced (level AAA) requirement for large text.- A normal text is regular text with a font size of less than 18 points (24px) or a bold text with less than 14 points (18.66px).
- A large text is a regular text with a minimum font size of 18 points (24px) or bold text with a minimum of 14 points (18.66px).
2. Beware of display: none
and visibility: hidden
CSS declarations
Screen readers ignore elements with a display: none
or visibility: hidden
CSS declarations. Therefore, do not apply them to content you wish to make accessible. Only use them to hide items from all users.
How to Use JavaScript to Create an Accessible Web App
Do not overuse JavaScript: Relying too much on JavaScript affects an app’s accessibility. Therefore, use JavaScript only where needed. For example, think carefully about whether you need a JavaScript-powered animation or whether a CSS animation would do the job.
Making your app accessible is a win-win situation. You gain more audience, and your users have a pleasant experience using your resource.