Darek Kay's picture Darek Kay

Accessibility Notes

My notes for making the web more inclusive. Don't follow this guide blindly. Read the references to learn more about certain rules.

Check out my general best practices for building better applications.

This page is a continuous work in progress.

Where to start?

Accessibility fundamentals are covered in the Web Fundamentals Guide (Google) and the Web Accessibility Course (Udacity/Google). Both resources are free.

To evaluate the accessibility of a web page, try out the following tools:




Best practices


Tools / Audit


Focus indicator

  • The focus indicator must have a contrast ratio of 3:1 against its adjacent elements, or be at least 2px wide. (WCAG 2.2)
  • The focus indicator must have a 3:1 (AA) / 4.5:1 (AAA) contrast ratio between its focused and unfocused states. (WCAG 2.2)
  • It is not required that hover as a state is differentiated from the default (and presumably all other) states.
  • Adjusting the flex order does not change the focus order.
  • Provide a fallback for Windows High Contrast mode when using a box-shadow focus indicator.
  • A keyboard-only focus ring has pros and cons, but it is technically possible using :focus-visible. Progressive enhancement handles older browsers.

Colors / Contrast Ratio




Screen reader



  • A screen reader may announce things differently than displayed in the text viewer. Pay attention to times, dates, currency, punctuation, special characters, emoji, math symbols, common (and uncommon) abbreviations & acronyms.
  • Minus the minus - A PSA about screen readers and negative numbers.
    • NVDA has fixed a related issue.
    • Talkback doesn't recognize the - character correctly.
  • Acronyms can usually be left as-is.
  • NVDA announces values differently between divs and spans.
  • NVDA does not announce emphasis elements (like em or strong).
  • Improve the announcement of phone numbers:
<a href="tel:703555121" aria-label="7 0 3. 5 5 5. 1 2 1.">(703) 555-121</a>


  • Settings:
    • ☑ Tools → Speech viewer
      • ☑ Show Speech Viewer on Startup
    • ☑ Preferences → Keyboard → Select NVDA Modifier Keys → caps lock
  • Addons:
  • Notes:
    • NVDA does not focus inline links in browse mode, unless the link appears at the start of a line.


  • Shortcuts:
    • Start: Cmd + F5
  • Settings:
    • ☐ Verbosity → Hints → Speak instructions for using the item in the VoiceOver cursor
    • ☑ Sound → Mute sound effects


Elements and Widgets

Date Picker

Something I see (...) is the frustration with date fields that are anything other than a plain text field for well-known dates (like birthdays).

Definition Lists

<dd>Black hot drink</dd>

<dd>White cold drink</dd>

It's worth noting that a definition list is the correct way to mark up a list of paired items. Changing markup patterns to satisfy the vagaries of specific assistive technologies tends to be a slippery slope. (source)

Dialog / Modal

  • There is no fixed rule where the focus should be moved to after opening a modal. A headline or the dialog itself are two good possibilities. There is an ongoing discussion about the default behavior for the HTML dialog element.


  • A legend has to be a direct child of a fieldset. A screen reader might not announce the label if the markup is malformed (e.g. NVDA). Solutions:
  • There was a Chrome bug, making it impossible to adjust the fieldset display value.

There are some rules regarding the <footer> element:

  1. The HTML footer element defines a contentinfo landmark when its context is the body element.
  2. The HTML footer element is not considered a contentinfo landmark when it is descendant of any of following elements: article, aside, main, nav, section

A contentinfo landmark role is used to identify information repeated at the end of every page of a website, hence a page should not have more than one contentinfo landmark.


  • A H1 doesn't have to come first (example).
  • These are no WCAG violations, but should still be avoided:
    • Missing or more than one <h1>.
    • Skipping heading levels.
    • Multiple headings with the same text.


  • Decorational images:

We tried to outsmart screen readers by letting them skip descriptive images. This turned out to be really unhelpful. Users that are not fully blind will still see an image and when the screen reader skips these images, users will assume they missed out on information. Solution: let the screen reader tell the users it’s a descriptive image. Or even better, write a descriptive alt-text for images. source


<div hidden>
<span id="new-window-0">Opens in a new window</span>
<span id="new-window-1">Opens an external site</span>
<span id="new-window-2">Opens an external site in a new window</span>


My site


<svg role="img">
<title>Lightbulb moment!</title>
<path d="..." />


<caption>Populations of cities</caption>


Video Player

Accessibility Notes