Accessibility refers to the inclusive practice of removing barriers. When digital products are correctly designed, developed and edited, all users have equal access to information and functionality.

Table of Contents

  1. Provide Alternative Description for Images

  2. Color and Color Contrast

  3. Create a Logical Reading Order

  4. Create Accessible Data Tables

  5. Accessible Forms

  6. Keyboard Accessibility

  7. Testing for Keyboard Accessibility

  8. Accessible PDFs

  9. Error and Alert Messaging

  10. Audio and Video Related Content

  11. Writing Content for Screen Readers

  12. Testing with Screen Readers

  13. Language Access

  14. Popups and Modal Windows

  15. Links and New Windows

Table of Contents

Provide Alternative Description for Images

Additional Information on Writing Effective Alt Text
https://webaim.org/techniques/alttext/

Color and Color Contrast

Color Contrast Between Text and Background Color

Color Contrast Between a) Link Text and Background Color and b) Link Text and Surrounding Body Text

Color Blindness

Challenges

Solutions

Reds and greens are often indistinguishable

This is not normally a problem except in cases where the colors convey important information. Under these circumstances you will need to either change the content or graphic or provide an additional means of obtaining the same information. For example, provide an explanation in the text itself.

Color and Alert/Error Messaging

Create a Logical Reading Order for Sighted and Vision Impaired Users

Page Structure and Headings

Proper nesting of headings.                                                              

Lists

Skip Repetitive Navigation and Provide Skip to Main Content Link 

This allows screen reader users to skip repetitive navigation menu links and go straight to the main content area.  

Example:

Create Accessible Data Tables for Screen Reader Users

 The purpose of data tables is to present tabular information in a grid, or matrix. Someone that cannot see the table cannot make the visual association between data in the table and their appropriate row and/or column headers. So proper markup must be used to make a programmatic association between elements within the table. When the proper HTML markup is in place, screen reader users can navigate through data tables one cell at a time, and they will hear the column and row headers spoken to them.

Example:

  <table>
<caption>2018 Asset Limits and Requirements Per Household</caption>
<thead>
  <tr>
    <th>
    </th>
    <th>
    </th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>
    </td>
    <td>
    </td>
  </tr>
</tbody>
</table>

Accessible Forms 

Forms need to be accessible to both screen readers and keyboard-only users.

Screen reader users typically navigate through a form using the Tab key to jump from form control to form control. Associated form labels are read for each form control when the user navigates to them. Any non-label text content between the form controls is usually skipped over. Be sure to include important cues or instructions in associated labels or at the beginning of the form.


Associate Labels Explicitly with Their Form Controls

The <label> element is used to associate a text label to a form control. This allows a screen reader to read the associated label text when the user navigates to the form control.

Example:

<label for=”name” class="control-label">Name</label>

<input placeholder="" id="name" formtype="c02" name="name" type="text">

Group Lists of Form Controls When There are Multiple Options to Select From

Please see example below.

<fieldset>
<legend>Name</legend>
<input id=”equityapplicant” type="checkbox" name="authorization" value="equityapplicant">
<label for="equityapplicant"> I am an Equity Applicant </label><br/>
<input id=”equityincubator” type="checkbox" name="authorization" value="equityincubator">
<label for="equityincubator"> My business is an Equity Incubator</label><br/>
<input id=”signedaffidavit” type="checkbox" name="authorization" value="signedaffidavit">
<label for=”signedaffidavit”> I registered my business with the Office of Cannabis and have signed an affidavit</label><br/>
<input id=”temporarypermit” type="checkbox" name="authorization" value=”temporarypermit”>
<label for=”temporarypermit”>I have a temporary cannabis permit</label><br/>
</fieldset>

Add a Title Attribute to Form Controls with No Labels

The preferred way is to include a form label with each form controls. However, if this is not possible use the title attribute to label form controls when the visual design cannot accommodate the label (for example, if there is no text on the screen that can be identified as a label) or where it might be confusing to display a label. User agents, including assistive technology, can speak the title attribute.

<input class="form-control" title=”Search Regulations” placeholder="Search regulations" name="q" type="text">

Add Required Information to Form Controls

Include the word ‘required’ in the form element to indicate mandatory form fields for screen reader users. 

Example: 

<label for="fname">Family Name *:</label>
 <input type="text" name="familyname" id="fname" 
 aria-required="true" required>

Accessible Autocomplete Forms

Screen-reader Interactions

Add ARIA Labels
Add role=”combobox” to the <input> field to tell screen reader users that the input field is an auto-suggest.

Add aria-autocomplete=”both” to the <input> field to tell screen reader users they can select from the suggestion list or type their own input. 

Add aria-live=”assertive” to announce the number of results available. The content of the <div>, which isn’t visible on screen, updates every time the list length changes.

Add aria-owns to the <input> field to link the suggestion list to the input field.

Add role=“listbox“ to the suggestion list <div> to tell screen reader users it contains a list of selectable items.

Add aria-activedescendant to the <input> element and populate it with the id of the currently highlighted list item. The aria-activedescendant value changes as the user presses the Up and Down arrows.

Add role=“option“ to each suggestion item, along with a unique id. That id is used by the aria-activedescendant attribute of the <input> element, whose value changes as users move through the list items with the arrow keys.

Add aria-expanded=”true” to indicate that the popup list is displayed.

Code Example

Here is an example of what the code would look like

<form action="">
	<div data-widget="accessible-autocomplete">
		<label for="name">Name:</label>
		<input type="text" id="name" class="autocomplete-search-field" aria-describedby="initInstr" aria-owns="results" role=”combobox” aria-expanded=”true” aria-autocomplete="both" aria-activedescendant="suggestion-1">
<div id=”results” class="autocomplete-list" role=”listbox”>
	<div class=”autocomplete-suggestion” id=”suggestion-1” role=”option”> Christina Lutz</div>
</div>
<span id="initInstr" style="display: none;">When autocomplete results are available use up and down arrows to review and enter to select.</span>
		<div aria-live="assertive" class="screen-reader-text">Two suggestions found, use up and down arrows to review</div>
	</div></form>

https://codepen.io/ademcifcioglu/pen/xdOyXv

Keyboard Accessibility

Keyboard accessibility is one of the most important aspects of web accessibility. Many users with motor disabilities rely on only using a keyboard to access content. Screen reader users who are blind or vision impaired will also use the keyboard to access and interact with content.  Here are some general best practices.

Users Should Have the Ability to Navigate Using Only the Keyboard

Natively-Accessible Keyboard Elements:

By default, users can navigate to links, buttons, and form controls with a keyboard. These elements are natively-accessible by using the following keystrokes.    

Keystrokes  Accessible Only Through a Screen Reader:

Landmarks and Roles

Here is an example:

<header role="banner">
   <p>Put company logo, etc. here.</p>
</header>
<nav role="navigation">
   <ul>
      <li>Put primary navigation here</li>
   </ul>
</nav>
<main role="main">
   <p>Put main content here.</p>
</main>
<footer role="contentinfo">
   <p>Put copyright, and footer related content , etc. here.</p>
</footer>

Common Landmarks and Roles

Provide other landmarks and roles as needed to specify areas/sections on a webpage. 

banner

Site-orientated content, such as the name of the web site, title of the page, and/or the logo.

<header role="banner"> </header>

main
The main or central content of the page.
<main role="main"></main>

search
This section contains the search functionality for the site.
<form role=”search”></form>

article
Stand-alone content that makes sense out of context from the rest of the document.
<article role=”article”></article>

complementary
Supporting content for the main content. For example, related links in a sidebar.  
<aside role=”complementary”></aside>

contentinfo
Informational child content, such as footnotes, copyrights, links to privacy statement, links to preferences, and so on.
<footer role=”contentinfo”></footer>

Buttons and Role Attribute

Most HTML elements have a default role that is presented to assistive technology. For example, a button has a default role of "button" and a form has a default role of "form". 

Always use the native button role so that keyboard only users are able access/select the buttons by using the tab and enter keys. 

Example:

<form action="/action_page.php" method="get" id="form1"></form>

<button type="submit" form="form" value="Submit">Submit</button>

But there are also buttons that are created that are not using a form element, just a regular hyperlink. Add a role attribute to those types of button links to help screen reader users identify the purpose of the link and for them to quickly be able to tab to all the buttons on the page by clicking on the “B” key. 

Example:

<a href="#" role="button" onclick="" class="btn btn-primary"><span>Apply Online</span></a>

Add Keyboard Focus Indicator to Menu Items, Buttons, Links, Form Elements 

A:focus

Testing for Keyboard Accessibility Using Natively-Accessible Keystrokes


Keyboard Testing on a MAC:

Configure macOS/OS X for Keyboard Accessibility

https://webassign.net/manual/student_guide/t_a_osx_tab_config.htm

Interaction

Keystrokes

Notes

Navigate to most elements

Tab

Shift + Tab - navigate backward

  • Keyboard focus indicators must be present.

  • Navigation order should be logical and intuitive.

Link

Enter


Button

Enter or Spacebar

Ensure elements with ARIA role="button" can be activated with both key commands.

Checkbox

TAB - Use the tab key to navigation between checkboxes Spacebar - check/uncheck a checkbox

Checkboxes should be used when one or more options can be selected.

Radio buttons

↑/↓ or ←/→ - select an option.

Tab - move to the next element.

Radio buttons should be used when only one option from a group can be selected.

Select (dropdown) menu

↑/↓ - navigate between menu options

Spacebar - expand

You can also filter by typing letters, but this behavior varies by browser. Some will filter as you type, like autocomplete. Others will only sort by first letter. E.g., in a list of US States, hitting A then R may take you to Arizona, or it may take you to Alabama and then Rhode Island.

Autocomplete

Type to begin filtering

↑/↓ - navigate to an option

Enter - select an option

Dialog

Esc - close

  • Modal dialogs should maintain keyboard focus.

  • Non-modal dialogs should close automatically when they lose focus.

  • When a dialog closes, focus should usually return to the element that opened the dialog.

Slider

↑/↓ or ←/→ - increase or decrease slider value

Home/End - beginning or end

  • For double-sliders (to set a range), Tab/Shift + Tabshould toggle between each end.

  • In some sliders PageUp/PageDown can move by a larger increment (e.g., by 10).

Menu bar

↑/↓ - Previous/next menu option

Enter - expand the menu (optional) and select an option.

←/→ - expand/collapse submenu

  • Not all menus should have these controls. Simpler menus should usually rely on Tab/Enter.

Tab panel

Tab - once to navigate into the group of tabs and once to navigate out of the group of tabs

↑/↓ or ←/→ - previous/next tab.

  • This is for 'application' tabs that change without loading a new page. If a menu looks like a group of tabs, but is actually a group of links to different pages, Tab and Enter are more appropriate.

  • The tab content should update automatically when pressing the arrow keys. You should not hit Enter to activate the tab.

'Tree' menu

↑/↓ - Navigate Previous/next menu option

←/→ - expand/collapse submenu, move up/down one level.


Scroll

↑/↓ - scroll vertically

←/→ - scroll horizontally

Spacebar/Shift + Spacebar - scroll by page

Minimize horizontal scrolling.


Accessible PDFs 

Just like webpages, PDF documents also need to be accessible to everyone, including users who rely on assistive technology such as screen readers.

Following are some basic steps to take in order to ensure your PDFs are accessible.

  1. Make sure the PDF is in text based format.

  2. Create a logical reading order by providing a main heading and subheadings.

  3. Tag your document in Microsoft Word
    Build the document structure and apply headings <h1>, <h2>, <h3>, <h4>, <h5>, etc.
    The <h1> heading should be reserved for the document title
    Add paragraphs <p>

  4. Add ALT text (alternative text) for images in Microsoft Word or in Adobe Acrobat

  5. Complex charts and graphics that are embedded in the PDF can’t be accessed by screen reader users. In these cases a summary or long description of what the chart/graphic conveys needs to be provided.  

  6. Make sure there is enough color contrast between text and background

  7. Do not use color as the ONLY way to convey informatio 

  8. Provide a table of contents for long document 

  9. Save your Word or PDF document as a tagged PDF. 

  10. Test your document in Adobe Acrobat for accessibility compliance. (please see link below for reference)

  11. Creating accessible Smart PDFs with forms
    Following are links to various resources on making your PDF documents accessible.


How to make your Microsoft Word document accessible by Microsoft:

How to create and verify accessible PDFs by Adobe:

How to create accessible forms inside Adobe:

How to create and repair tables inside Adobe:

How to use the accessibility checker by Adobe:

How to repair or remediate old PDFs by Adobe:

Alert and Error Messaging

Make sure that error and alert messages are accessible to screen reader users. 

General Guidelines

Do not rely on color alone to convey the error or alert message when something is not completed correctly or missing. 

Provide a description of the nature of the error message as well as an anchor link to the location of the error message. Example: “Please provide the correct date of birth. The primary applicant must be 18 years of age or older”.

Non-Compliant Error Message Treatment


Compliant Error Message Treatment


Accessible Inline Error Messages

Make inline error messages accessible to screen reader users by adding ARIA labels.

Code Example:

Default Error Message Treatment

<form novalidate>
<label for="name"> Name:</label>
<input id="name" hrequired aria-invalid="false">
</form>

Invalid Error Message Treatment

<form novalidate>
<label for="name">  Name:</label>
<input id="name" required aria-describedby="name_msg" aria-invalid="true">
<span id="name_msg">Please enter your name.</span>
</form>
<form novalidate>
<label for="Email">  Email:</label>
<input id="Email" required aria-describedby="emal_msg" aria-invalid="true">
<span id="email_msg">The email address entered is invalid.</span>
</form>

https://codepen.io/TPG/pen/3b68c22db120c0960503fe892bb2c068

Audio and Video Related Content

Users who are deaf, hard of hearing, or having trouble understanding the audio information must be provided with a text based alternative.   

Video Content with Audio 

Captioning should be provided for the audio portion of a video.  The captioning must be synchronized with the audio so that someone reading the captions could also watch the speaker and associate relevant body language with the speech. 

Audio-Only Content with No Video 

Audio files with no video are not considered multimedia. However, since audio is a non-text element one of the following text-equivalents must be provided for deaf or hearing impaired users.  

Writing Content for Screen Readers

General Writing Guidelines

Non-Compliant Link Examples

Compliant Link Examples

Contact the County Clerk 

Contact the County Clerk

Click here to visit the Mayor’s website

Visit the Mayor’s website

How Screen Readers Read Content in General

Testing with Screen Readers

The following are the most common screen reader/browser combinations used among vision impaired users.

  1. NVDA (this is a free, open source, Windows based software) + Firefox  - 72%

  2. JAWS (Windows based) + Internet Explorer, Chrome or FF  -  61%

  3. VoiceOver (iOS) + Safari - 47%

JAWS is not compatible with Microsoft Edge.

All screen readers share similar functionality and capabilities. However, keyboard shortcuts, voices, and ways of calling out links, images, and so on, vary between them. Since users will be accustomed to their preferred screen reader’s conventions, these differences don’t typically impact coding practices. The key is to adhere to accessibility standards and generally-accepted accessibility techniques.

How to enable VoiceOver on the Mac

https://www.imore.com/how-enable-voiceover-mac

Language Access

General Guidelines
Per the City and County of San Francisco’s Language Ordinance, site content should be available in the following languages.

JAWS Screen Reader and Languages

JAWS provides language switching with any supported speech synthesizer. When a Web page author indicates the language of an entire page, or just part of a page, if the synthesizer in use supports that language, JAWS uses the language specific version of the synthesizer to speak the text. The synthesizer must support the language of the information. If the synthesizer does not support the language specified for a page or part of a page, JAWS still indicates the language of the information. For example for Chinese JAWS will say, “heading level 2 , Chinese”

The languages that are spoken by JAWS depends on the synthesizer currently in use.  If you are using the default Eloquence synthesizer that is installed with JAWS, the following languages are available: 

  • American English

  • British English

  • Castilian Spanish

  • Latin American Spanish

  • French, French Canadian

  1. German

  2. Italian

  3. Brazilian Portuguese

  4. Finnish


Links and New Windows

From an accessibility perspective, the preference would be to always open links within the same window rather than opening them up in a new window. 

The reason for this is that some users, especially screen reader users, can get confused or disoriented with the new windows or tabs. If a new window or tab is opened a screen reader user should be notified of this ahead of time. Newer screen readers will alert the user when a link opens a new window, but this only happens after the user clicks on the link. Older screen readers don’t alert users at all. Sighted users with cognitive disabilities may also have difficulty interpreting what just happened when a new tab/window is opened. Then when they try to click on the browser Back button nothing happens, because there is no previous link to go back to in a new window or tab.

Popups/Modals

Popups and modal windows are not a good user experience for keyboard-only/screen reader users and as a rule of thumb we should steer away from using them. Instead we should try and find a different solution.

When a popup appears it does not have keyboard focus which means that keyboard only/screen reader users are unable to tab to the content within the popup. Screen reader and keyboard-only users can easily become distracted and disoriented. 

If there is absolutely no other solution than a popup/modal, it must be programmed in a way that allows for the following.

Tools and Resources

Color Contrast Checker by WebAIM

Color Blindness Filter by Toptal

Accessible PDFs - Adobe Acrobat Pro and Microsoft Word
How to make your Microsoft Word document accessible by Microsoft:

How to create and verify accessible PDFs by Adobe:

How to create accessible forms inside Adobe:

How to create and repair tables inside Adobe:

How to use the accessibility checker by Adobe:

How to repair or remediate old PDFs by Adobe:

Web Accessibility Testing Tools

Writing Effective ALT Text for Images