✒️
SEI 802
  • Introduction
  • About These Notes
  • Syllabus
  • Development Workflow
    • Installfest
      • Mac OSX
      • Linux
      • Git Configuration
      • Sublime Packages
    • Command Line
      • The Terminal
      • Filesystem Navigation
      • File Manipulation
      • Additional Topics
    • Intro to Git
      • Version Control
      • Local Git
      • Remote Git
      • Git Recipes
    • Group Collaboration
      • Git Workflows
      • Project Roles and Tools
    • VS Code Tips & Tricks
  • HTML/CSS
    • HTML
    • CSS Selectors
    • CSS Box Model and Positioning
      • Box Model
      • Display and Positioning
      • Flexbox
      • Grid
      • Flexbox & Grid Games
      • Floats and Clears
      • Additional Topics
    • Advanced CSS
      • Responsive Design
      • Pseudo-Classes/Elements
      • Vendor Prefixes
      • Custom Properties
      • Additional Topics
    • Bootstrap
    • CSS Frameworks
    • Accessibility
  • JavaScript
    • Primitives
    • Arrays
    • Objects
    • Control Flow
      • Boolean Expressions
      • Conditionals
      • Loops
      • Promises
    • Functions
      • Callbacks
      • Timing Functions
      • Iterators
    • DOM and Events
    • DOM Manipulation
    • HTML5 Canvas
    • How To Reduce Redundancy
    • (2019) JavaScript OOP
    • (2016) OOP with Classes
    • (1995) OOP with Prototypes
      • Constructors
      • Prototypes
    • Intro to TDD
    • Scoping
    • Inheritance
      • Prototypal Inheritance
      • Call, Apply, and other Functions
      • ES6 Inheritance
      • Resources
    • Custom Node Modules
    • Additional Topics
      • AJAX, Fetch, and Async/Await
      • AJAX w/JSON and Localstorage
        • AJAX w/JSON
        • Local Storage
      • Async module
      • Data Scraping
  • jQuery
    • Intro
      • DOM Manipulation
      • Reddit Practice
      • Styling
      • Events
    • Plugins
    • AJAX
  • APIs
    • Fetch
    • AJAX w/jQuery
    • AJAX w/Fetch
  • Databases
    • Intro to SQL
    • Advanced SQL
    • MongoDB
      • Intro to NoSQL
      • CRUD in MongoDB
      • Data Modeling
      • Intermediate Mongo
  • Node/Express
    • Node
      • Intro to Node
      • Node Modules
      • Node Package Manager (NPM)
    • Express
      • Intro to Express
        • Routes
        • Views
        • Templates
        • Layouts and Controllers
        • CRUD & REST
          • Get and Post
          • Put and Delete
      • APIs with Express (request)
      • APIs with Express (axios)
    • Sequelize
      • Terminology
      • Setup
      • Using Models
      • Seeding Data
      • Validations and Migrations
      • Resources
      • 1:M Relationships
      • N:M Relationships
    • Express Authentication
      • Research Components
      • Code Components
      • Auth in Theory
        • Sessions
        • Passwords
        • Middleware
        • Hooks
      • Auth in Practice
        • Create the User
        • User Signup
        • Sessions
        • User Login
        • Authorization and Flash messages
    • Testing with Mocha and Chai
    • Mongoose
      • Mongoose Associations
    • JSON Web Tokens
      • Codealong
    • Additional Topics
      • oAuth
      • Geocoding with Mapbox
      • Geocoding and Google Maps
      • Cloudinary
      • Websockets with Socket.io
      • SASS
  • Ruby
    • Intro to Ruby
    • Ruby Exercises
    • Ruby Classes
    • Ruby Testing with Rspec
    • Ruby Inheritance
    • Ruby Data Scraping
  • Ruby on Rails
    • Intro to Rails
    • APIs with Rails
    • Asset Pipeline
    • Rails Auth and 1-M
      • Auth Components
    • Rails N:M
    • ActiveRecord Polymorphism
    • Additional Topics
      • oAuth
      • SASS
      • Rails Mailers
      • Cloudinary
      • Jekyll
  • React (Updated 2019)
    • ES6+/ESNext
      • Const and Let
      • Arrow Functions
      • Object Literals and String Interpolation
      • ES6 Recap
      • ES6 Activity
    • Intro to React
      • Create React App
      • Components and JSX
      • Virtual DOM
      • Props
      • Dino Blog Activity
      • Nested Components
      • Lab: LotR
    • React State
      • Code-Along: Mood Points
      • Code-Along: Edit Dino Blog
      • Lab: Simple Calc
      • Lifting State
    • React Router
      • Browser History/SPAs
      • React Router (lesson and full codealong)
      • Router Lab
    • Fetch and APIs
      • APIs with Fetch and Axios
      • Fetch the Weather
    • React Hooks
    • React LifeCycle
      • Lab: Component LifeCycle
    • React Deployment
    • Additional Topics
      • React Frameworks
        • Material UI Theming
      • Typescript
        • More Types and Syntax
        • Tsconfig and Declaration Files
        • Generics with Linked List
      • Redux
      • TypeScript
      • Context API
      • React Native
  • Meteor
  • Deployment and Config
    • Deploy - Github Pages
    • Deploy - Node/Sequelize
    • Deploy - Node/MongoDB
    • Deploy React
    • Deploy - Rails
      • Foreman (Environment Variables)
    • Deploy - AWS Elastic Beanstalk
    • Deploy - S3 Static Sites
    • Deploy - Django
    • Deploy - Flask
  • Data Structures and Algorithms
    • Recursion
    • Problem Solving - Array Flatten
    • Binary Search
    • Algorithm Complexity
    • Stacks and Queues
    • Bracket Matching
    • Ruby Linked Lists
      • Sample Code
      • Beginner Exercises
      • Advanced Exercises
    • JS Linked Lists
      • Sample Code
      • Beginner Exercises
      • Beginner Solutions
    • Hash Tables
    • Intro to Sorting
    • Insertion Sort
    • Bucket Sort
    • Bubble Sort
    • Merge Sort
    • Quick Sort
    • Heap Sort
    • Sorting Wrapup
    • Hashmaps
    • Trees and Other Topics
  • Python
    • Python Installation
    • Intro to Python
    • Python Lists
    • Python Loops
    • Python Dictionaries
    • Python Sets and Tuples
    • Python Cheatsheet
    • Python Functions
    • Python Classes
    • Python Class Inheritance
    • Intro to Flask
    • Intro to SQLAlchemy
      • Flask and SQLAlchemy
    • Using PyMongo
    • Intro to Django
    • CatCollector CodeAlong
      • URLs, Views, Templates
      • Models, Migrations
      • Model Form CRUD
      • One-to-Many Relations
      • Many-to-Many Relations
      • Django Auth
    • Django Cheatsheet
    • Django Auth
    • Django Polls App Tutorial
    • Django School Tool Tutorial
    • Django 1:M Relationships
    • Custom Admin Views
    • Data Structures and Algorithms
      • Recursion
      • Binary Search
      • Stacks and Queues
      • Linked Lists
      • Binary Trees
      • Bubble Sort
      • TensorFlow & Neural Networks
    • Adjacent Topics
      • Raspberry Pi
      • Scripting
  • Assorted Topics
    • History of Computer Science
    • Regular Expressions
    • Intro to WDI (Course Info)
    • Being Successful in WDI
    • Internet Fundamentals
      • Internet Lab
    • User Stories and Wireframing
      • Wireframing Exercise: Build an Idea
    • Post WDI
      • Learning Resources
      • Deliverables -> Portfolio
      • FAQ
  • Projects
    • Project 1
    • Project 2
    • Project 3
      • Project 3 Pitch Guidelines
    • Project 4
    • Past Projects
      • Project 1
      • Project 2
      • Project 3
      • Project 4
      • Portfolios
    • Post Project 2
    • MEAN Hackathon
      • Part 1: APIs
      • Part 2: Angular
    • Portfolio
  • Web Development Trends
  • Resources
    • APIs and Data
    • Tech Websites
    • PostgreSQL Cheat Sheet
    • Sequelize Cheat Sheet
    • Database Administration
  • Archived Section
    • (Archived) ReactJS
      • Intro to React
        • Todo List Codealong
        • Additional Topics
      • Deploy React
      • React with Gulp and Browserify
        • Setting up Gulp
        • Additional Gulp Tasks
      • React Router
        • OMDB Router
        • OMDB Search
        • Additional Resources
      • React Animations
        • CSS Animations
    • AngularJS
      • Intro to AngularJS
        • Components and SPA
        • Create an Angular App
      • Angular Directives and Filters
      • Angular Animation
      • Angular Bootstrap Directives
        • Bootstrap Modals
      • Angular $http
      • Angular Services
        • Service Recipes
        • ngResource
        • Star Wars Codealong
      • Angular Routing
      • Angular + Express
      • Angular Authentication
        • Additional Topics
      • Angular Components
      • Angular Custom Filters
      • Angular Custom Directives
Powered by GitBook
On this page
  • Lesson Objectives
  • What is Accessibility in Terms of a Web Page?
  • Why Accessibility?
  • How Do We Accomplish Accessibility?
  • Alt Text
  • Link Text
  • Header Heirarchy
  • Text Contrast
  • Use Headers Without a Mouse
  • Skip to Main Content
  • ARIA
  • Semantic Tags
  • Accessible Web Forms
  • Accessible Names for Icons
  • Captioned Videos
  • No Strobe Lights!
  • Conclusion and Resources

Was this helpful?

  1. HTML/CSS

Accessibility

Lesson Objectives

After this lesson, you will be able to...

  • Define accessibility in terms of web development

  • Describe why accessibility is an important topic

  • Name a few ways to improve accessibility on a website

What is Accessibility in Terms of a Web Page?

You may hear the word "accessibility" and think of wheelchair ramps and wonder what that has to do with web development. In fact, an accessible website is one that anyone with a disability can use. This includes the obvious: people who are blind and depend on a screen-reader, but it also includes other disabilities such as:

  • auditory

  • cognitive

  • visual (not just blindness)

  • physical

  • neurological

  • speech

Why Accessibility?

There are several ways to improve the accessibility of your website, but what about the greater question... why bother? You may note that most of the ways to improve accessibility include extra time and more typing. Why do that when there are deadlines looming and other shinier things that might make money?

Believe it or not, accessibility is totally a money issue. One reason is that you're excluding potential customers. Most websites make money by selling products, accumulating user data, showing ads on their site, or some combination of those things. However, if your site isn't accessible, there are whole demographics left out of your customer base that will never be reached.

In 2020, when we get new figures, please bug your instructor for an update!

Additionally, there is an issue of fairness, from which the ADA compliance laws stem. As put by the person who invented the internet:

In other words, our usage of the web is so pervasive, that you couldn't really live a normal life if you weren't able to use it.

One last reason to make your website accessible (if you weren't convinced already) is that an accessible website is often good for people without a disability too. Think about how we increasingly use smaller or embedded devices, or the fact that people can have "temporary" or even "situational" disabilities, like a broken arm or inability to read a screen in bright sunlight. Because of its emphasis on logical ordering, it can also be useful for people with slow internet connections who may not get the benefit of your fancy CSS and JavaScript.

In conclusion, we care about accessibility for the following reasons:

  • It's costing real money

  • It's a matter of fairness

  • It also benefits non-disabled people

How Do We Accomplish Accessibility?

Okay, it's important, but where do we even start?

Alt Text

All of your image tags are required to have alternate (alt) text attribute. That looks something like this in your HTML:

<img src="https://media.giphy.com/media/C9ttWNVgNj4Qw/giphy.gif" alt="Kitten falling over">

Tip: If an image is purely decorative, you can provide an empty value to the alt attribute to indicate to a screen reader it should be ignored. (i.e., alt="")

Link Text

Make your link text as descriptive as possible. Try to avoid text like "Click Here".

YES:

Read more on <a href="mysistersblog.com">my sister's website</a>

NO:

<a href="mysistersblog.com">Read more</a> on my sister's website!

Header Heirarchy

Your site should have properly nested headers. This means, you have just one <h1> tag and the second level headers are <h2>, and so on. You wouldn't skip from <h2> to <h4> without also using an <h3> in between.

YES:

<h1>Main Page Title</h1>
<h2>Super Important Topic</h2>
<h3>Sub-Topic 1</h3>
<h3>Sub-Topic 2</h3>
<h4>Details about sub-topic 2</h4>
<h3>Sub-Topic 3</h3>
<h2>Another Super Important Topic</h2>
<h3>Sub-Topic</h3>

NO:

<h1>Main Heading</h1>
<h1>Another Main Heading</h1>
<h1>Everything I Say Is Super Important??</h1>
<h4>Except this apparently</h4>
<h1>Another Main Heading!</h1>

ALSO NO:

<h1>Main Page Title</h1>
<h6>Well, I like to use the headings to size my text, even though that's what CSS is for</h6>

Text Contrast

Can your text be easily read? UX Designers you work with may be able to get technical about contrast ratios, but the bottom line is don't put text on a background that is too close in hue to its background color. This is even more important for small text.

Use Headers Without a Mouse

Can all your header links and dropdown items be accessed without a mouse (by keyboard alone)? Are you sure? If you used a CSS framework's blueprint for a header the answer is probably yes, but if you just made one yourself... double-check!

Skip to Main Content

Speaking of headers, you've likely been on a website that has 60 or 70 links in a huge header with lots of dropdowns and sub-menus. If you've got to press "tab" 70 times to get to the main content, that isn't exactly accessible. Include a skip to main content link to further down on your page.

ARIA

ARIA stands for Accessible Rich Internet Application. It's used to denote the purpose of things like sliders, tooltips, and tab panels that otherwise wouldn't be able to be understood simply by looking at the HTML alone.

<!-- This is a tabs widget. How would you know, looking only at the markup? -->
<ol>
  <li id="ch1Tab">
    <a href="#ch1Panel">Chapter 1</a>
  </li>
  <li id="ch2Tab">
    <a href="#ch2Panel">Chapter 2</a>
  </li>
  <li id="quizTab">
    <a href="#quizPanel">Quiz</a>
  </li>
</ol>

<div>
  <div id="ch1Panel">Chapter 1 content goes here</div>
  <div id="ch2Panel">Chapter 2 content goes here</div>
  <div id="quizPanel">Quiz content goes here</div>
</div>

The answer is basically, you wouldn't have any way of knowing. That's where ARIA comes in. Here's an example of the same thing, but properly labelled.

<!-- Now *these* are Tabs! -->
<!-- We've added role attributes to describe the tab list and each tab. -->
<ol role="tablist">
  <li id="ch1Tab" role="tab">
    <a href="#ch1Panel">Chapter 1</a>
  </li>
  <li id="ch2Tab" role="tab">
    <a href="#ch2Panel">Chapter 2</a>
  </li>
  <li id="quizTab" role="tab">
    <a href="#quizPanel">Quiz</a>
  </li>
</ol>

<div>
  <!-- Notice the role and aria-labelledby attributes we've added to describe these panels. -->
  <div id="ch1Panel" role="tabpanel" aria-labelledby="ch1Tab">Chapter 1 content goes here</div>
  <div id="ch2Panel" role="tabpanel" aria-labelledby="ch2Tab">Chapter 2 content goes here</div>
  <div id="quizPanel" role="tabpanel" aria-labelledby="quizTab">Quiz content goes here</div>
</div>

Semantic Tags

Semantic tags are descriptive of using the HTML tags in a way that conveys their purpose. So for example, using an <h1> as a first-level heading and not just a way to make your text big. Another example of a non-semantic usage is using a <p> tag to create extra space, as opposed to making a paragraph text like it is supposed to.

Generally using tags to create space is bad. Remember to make CSS do its job!

Semantic tags, particularly HTML5 additions, often tend to highlight sections of your website, so they are very, very helpful for screen readers. Otherwise a screen reader doesn't necessarily know what order to consume information.

Common semantic tags include:

  • nav

  • main

  • footer

  • section

  • aside

  • summary

  • details

Accessible Web Forms

That <label> tag you are likely tired of typing in your forms has a purpose. The <fieldset>, <legend> and <label> tags are designed for web accessibility and aiding screen readers to properly interpret the form. Fieldset lets you group parts of a form together. Legend defines what a fieldset is for. Labels are for inputs. You can either nest your input inside a label or you can put the label first and then as a sibling put the corresponding input. If you choose to use sibling elements, the label must have a for attribute and the input tag must have an id attribute that have matching values.

<form>
    <label for="username">Your Username:</label>
    <input type="text" id="username">
</form>

Accessible Names for Icons

Somewhat related to alt text for images, there should be accessible names for every visual component. You might not think twice about using an icon for an edit button or a delete button or something else, but how is a screen reader supposed to know how to deal with it?

<i aria-hidden="true" class="fas fa-car" title="Time to destination by car"></i>
<span class="sr-only">Time to destination by car:</span>
<span>4 minutes</span>

As you can see, the icon has a title and a name that describes it ("fa-car" where "fa" just stands for "Font Awesome"). Additionally there is a span tag with "sr-only" (screen reader only, not for display - this is a class defined in the Bootstrap CSS framework) to describe verbally what a seeing user would understand from the icon or picture.

Captioned Videos

You didn't think so much about vision impairment that you forgot about hearing impairment did you? All videos with sound should be captioned or should be provided with a transcript!

No Strobe Lights!

Though it may be tempting, your pages shouldn't contain any quick flashing!

Conclusion and Resources

Remember, this is far from an exhaustive list! All of the above examples were just some highlights we picked out to discuss. Feel free to dive deeper with these as a starting point:

PreviousCSS FrameworksNextJavaScript

Last updated 3 years ago

Was this helpful?

Another, perhaps less obvious monetary reason to get ADA compliant is that companies do get sued over accessibility issues. In fact, , the number of lawsuits of website accessibility tripled between 2017 and 2018. Most sources expect that number to continue to rise.

"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect." -Tim Berners Lee ()

The first thing we should know about are the official standards that are cited in the above mentioned lawsuits, the . However, these docs can be a bit dense for those of us who aren't super into reading technical documents. Here's a couple of .

describes the following issue. How would you know that the following described a tab list and tab panel? (Particularly if the developer had chosen poor naming conventions?)

describes a great way to use a car icon:

The Cheat Lightswitch Rave

according to a recent study done by a law firm
Source
Web Content Accessibility Guidelines
important highlights modified from this blog
MDN's ARIA page
Font Awesome Icons Accessibility Page
W3C
Web Content Accessibility Guidelines 2.1
MDN's Intro to ARIA
WAI-ARIA Docs
ADA Lawsuits Source
Accessibility Checklist
Web AIM: Compliance Test Website