What Developers Need to Know About HTML Accessibility

#HTMLAccessibility #webaccessibility

Our methodology

Our unique research methodology for digital accessibility combines user testing, feature analysis, and hands-on experience. We review various remediation software and platforms to provide top recommendations.

Written and researched for humans by humans

Photo of Expert
Ajay Sohal
Expertly reviewed by
Comments: 0
Scan your website for accessibility related issues for free

Web accessibility has become an integral part of doing business online, but it can be a lot more time-consuming to implement if you leave it too late.

Disabled users require specific functionality to be able to engage with a website in the same way that other users do, which is where accessibility comes in. 

A best practice is to take accessibility into account right from the start – before you even begin the development process. This will ensure that you don’t need to scramble to make complex changes later on.

In this article, we will cover some basic HTML5 accessibility guidelines that will help you create a site that complies with WCAG regulations. 

For more detailed information on WCAG and compliance, read this guide to achieving ADA compliance.

How to Meet HTML Accessibility Standards

Let’s start with some of the basic steps you would take to make an HTML-based site accessible.

Add Alt Text

For a site to be compatible with screen readers, it’s important to add text alternatives, or alt text, to your images. This tag is added as an attribute to the <img> tag and gives the image more context. 

An example would be <img src=”https://examplewebsite.com/file:roses.jpg” alt=”A bunch of red roses“/>

If a user accesses a website with a screen reader, it would read this alt tag aloud, ensuring they know exactly what’s on their screen. This is also why it’s important to use clear alt text. 

Incorporate the Correct Semantic Tags

As an HTML developer, you already know what semantic tags are, but how you use them will change when you are developing an accessible website.

For example, <b> and <strong> tags do the same thing and are interchangeable. However, this is not the case in terms of accessibility.

On an accessible website, <b> indicates how text should look, while <strong> denotes how text should be understood. Basically, a screen reader will interpret each of these tags differently and read them out differently too. 

Note: Overall, if you are using semantic tags on a site, make sure that you’re using the same pairs to create a more accessible site. 

Use ARIA

Also known as Accessible Rich Internet Applications, ARIA consists of a series of markup extensions that can be added to elements to provide screen readers with more information on them. 

In turn, this ensures that visually impaired users have a better idea of what’s appearing on a webpage. 

For example, an ARIA attribute can indicate the role or function that a particular element has on a page. Navigation bars, forms, and checkboxes are all examples of elements that you can apply ARIA to. It can also help with HTML table accessibility.

To make a website accessible, make a point of adding ARIA attributes to any elements that you feel will give screen readers and users more context. You can find detailed documentation on ARIA attributes in this guide to HTML accessibility.

Additional HTML Accessibility Tips

Now that you know the basics you need to cover, let’s delve into some additional steps you can take to achieve HTML accessibility. 

You will also find this general ADA compliance checklist useful during this process.

Only Use Container Elements for Layouts

In terms of accessibility, it’s important to only use <div> and <span> tags for layouts. The reason for this is that assistive technology doesn’t interact with these tags. So, by using <div> or <span> around important elements such as a form or button, a user will miss out on them completely. 

Develop with the User in Mind

Understandably, HTML elements are used to create specific designs and alter graphics. However, if you want a site to be accessible and compliant, it’s best to only use HTML elements in the way that you’re meant to. This ensures that assistive technology and browsers are interpreting each element correctly.

Use the Correct Headings

Headings are one of the most important elements on any site. Not only do search engines rely on headings to understand your site, but visitors use them to skim your pages. 

Using the correct headings on your site creates a better structure and highlights the relationship between different sections – it’s also what helps screen readers navigate and understand your site. 

Here are some guidelines for using headers on your site:

  • <H1> is reserved for your main headings and you should only use one per page.
  • Your header tags should always be in the correct order. <H1> should be followed by <H2>, which should be followed by <H3> etc.
  • You shouldn’t skip levels when you’re increasing the size of your headers but you can when you’re decreasing them. 

Declare the Language

The final tip on this list is to always include the lang attribute inside the <html> tag on your site – this ensures assistive technology knows what language to expect. It’s also best to include this attribute for SEO purposes.

Wrapping Up

In the end, you want to provide website visitors with the most seamless experience possible, including those living with disabilities. 

Web accessibility is no longer something we can ignore, especially with so many people relying on the internet to perform day-to-day activities. 

Coding an HTML website with accessibility in mind is one of the fastest and easiest ways to achieve WCAG and ADA compliance. And the guidelines mentioned above are the best place to start!

Find out whether your HTML website is accessible or not by conducting a test on Accessibility Checker

Learn More

Want to learn more about accessibility and the web design process? Here are some recommended blogs:

How we reviewed this article
  1. Current version
  2. Modified November 30, 2022

    What we changed

    Article was reviewed by an expert

  3. First Draft of the Article March 10, 2022
I have been helping global businesses bring their brands to life online for over 14 years now and I still love it! I am particularly passionate about ensuring online content is accessible to everyone. I’ve spent years learning as much as possible about web accessibility, ensuring I can educate others on its importance no matter what sector they are in.

Danny Trichter is a dedicated researcher specializing in digital accessibility, ensuring that websites and digital platforms are usable by everyone, including those with disabilities. Beyond his professional pursuits, Danny enjoys exploring new destinations, sharing his travel experiences on his blog, and discovering hidden gems in Thailand where he currently resides. In his leisure time, he loves hiking, connecting with nature, and capturing the beauty of the world through his camera lens

0 comments

Subscribe
Notify of
guest
0 Comments
Oldest
Newest
Inline Feedbacks
View all comments