Accessibility

Web Accessibility Basics Every Site Should Cover

By BitStyled Editorial Team · · 4 min read

Web accessibility means building sites that people can use whatever their abilities or circumstances. That includes people who are blind or have low vision, people who cannot use a mouse, people who are deaf or hard of hearing, and people with cognitive differences. It also includes anyone with a broken arm, a glaring screen in bright sunlight or a slow connection.

Accessibility is not an extra layer added at the end. Most of it comes from writing clean, honest HTML and thinking about how real people use a page. This guide covers the basics that every site should get right.

Start With Semantic HTML

The most effective accessibility step costs nothing: use the right element for the job.

  • Use <button> for actions and <a> for navigation, not clickable <div> elements.
  • Use headings (<h1> to <h6>) in a logical order, so the page has an outline.
  • Use <nav>, <main>, <header>, <footer> and <section> to mark the regions of the page.
  • Use <ul> and <ol> for lists, and <table> only for real tabular data.

Browsers and assistive technology understand these elements automatically. A real button, for example, is focusable, activates with Enter and Space, and is announced as a button, all without extra code.

Write Useful Text Alternatives

Images need an alt attribute that describes their purpose.

<img src="chart.png" alt="Bar chart showing monthly visitors rising from January to June">
  • Describe the meaning of the image, not just its appearance.
  • If an image is purely decorative, use an empty alt="" so screen readers skip it.
  • Do not start with "image of" because the reader already announces it as an image.
  • For complex charts, give a fuller description nearby in the text.

Videos need captions, and audio content needs a transcript.

Make Everything Work by Keyboard

Many people navigate without a mouse. Test your site by pressing Tab, Shift and Tab, Enter, Space and the arrow keys.

  • Every interactive element must be reachable and usable.
  • The tab order should follow the visual order.
  • Never remove the focus outline unless you replace it with something equally clear.
  • Avoid keyboard traps, where focus enters a component and cannot leave.
  • Provide a skip link at the top of the page, so users can jump past repeated navigation to the main content.

Modal dialogs deserve extra care. They should move focus inside when opened, keep it there, and return it to the trigger on close.

Choose Colors With Enough Contrast

Text must stand out from its background. The Web Content Accessibility Guidelines (WCAG) set minimum contrast ratios: 4.5 to 1 for normal text and 3 to 1 for large text and key interface parts.

  • Check your color pairs with a contrast checker.
  • Do not rely on color alone to convey meaning. A red error message should also include an icon or text such as "Error."
  • Allow users to zoom and resize text without breaking the layout.
  • Use relative units such as rem for font sizes.

Label Forms Properly

Forms are where accessibility failures cost people the most.

<label for="email">Email address</label>
<input id="email" name="email" type="email" autocomplete="email" required>
  • Every input needs a visible label connected with for and id.
  • Do not use placeholder text as the only label, since it disappears when typing.
  • Group related fields, such as radio buttons, using <fieldset> and <legend>.
  • Write error messages that say what went wrong and how to fix it, and connect them to the field.
  • Use the correct type and autocomplete values to help users and assistive tools.

A screen reader user can pull up a list of all links on a page. A list full of "Click here" and "Read more" is useless. Make link text meaningful on its own, such as "Read the setup guide." Icon-only buttons need a text name, which you can provide with aria-label or visually hidden text.

Use ARIA Carefully

ARIA is a set of attributes that add accessibility information when HTML alone is not enough. The first rule of ARIA is to avoid it when a native element does the job. Misused ARIA can make things worse than none. Use it for custom widgets, live updates and states such as aria-expanded, and test with a screen reader.

Structure Content for Reading

  • Write in plain language and keep paragraphs short.
  • Set the page language with the lang attribute on the <html> element.
  • Give every page a unique, descriptive <title>.
  • Avoid content that flashes more than a few times per second, which can trigger seizures.
  • Respect the user's reduced motion preference with the prefers-reduced-motion media query.

How to Test

No tool catches everything, so combine methods.

  1. Run an automated checker, which finds many common issues such as missing labels and low contrast.
  2. Navigate the whole site using only the keyboard.
  3. Try a screen reader on at least one key journey.
  4. Zoom the page to a large size and check for broken layouts.
  5. Where possible, involve people who use assistive technology.

Frequently Asked Questions

Is accessibility only about blind users?

No. It covers vision, hearing, movement and cognitive needs, and it also helps people in temporary or situational limits, such as using a phone one-handed or watching a video without sound.

Do I need ARIA on every page?

No. Well written semantic HTML usually needs little or none. Add ARIA only for custom components or states that native elements cannot express, and follow established patterns.

Is accessibility a legal requirement?

In many countries, laws and regulations require certain organizations to make their sites accessible, and requirements differ by region. Check the rules that apply to you. Regardless of law, accessible sites reach more people.

Related reading