SlideShare a Scribd company logo
Building An
Accessible Site from
  the Ground Up
Russell Heimlich @KingKool68

 ‣Web Developer at the Pew Research Center
 ‣http://www.russellheimlich.com/blog
I Like Funny T-Shirts
What is accessibility?




 http://www.flickr.com/photos/artbystevejohnson/4610457832/
Accessibility is NOT
just about people with
      disabilities.
Accessibility is about
     PEOPLE!



 http://www.flickr.com/photos/elvire-r/2451784799/
Devices

 ‣Desktop Computer
 ‣Mobile
 ‣In Between (iPad, Netbooks)
 ‣TV’s


                                http://www.flickr.com/photos/krossbow/4757275301/
Interactions

 ‣Mouse
 ‣Keyboard
 ‣Touchscreen
 ‣Screenreader

                 http://www.flickr.com/photos/a6u571n/3207185886/
Technologies

 ‣JavaScript
 ‣CSS
 ‣Images       display: none;
So what can be done
 to make websites
 more accessible?
Think About The
    HTML
Use the Right Element for the Job
<p> = paragraph

<h1>-<h6> = Heading 1 through 6

<div class=”paragraph”>

Using Tables for Layout
Be Aware of the Source Order

 ‣Markup content the way it should be read NOT the
  way it should be displayed.


  Header                                Header

                                Aside      Content
 Content


 Aside
Create Consistent Conventions
<div id=”header”>

<ul id=”nav”>

<div id=”content”>

<div id=”sidebar”>

<div id=”footer”>
Use Alt Attributes on <img>

 ‣Include text to display as a backup
 ‣Provide context to what the user is missing
 ‣If the image is purely decoration use alt=””
Style Alt Text
a img {
   background-color:#EDEBD5;
   border:medium none;
   color:#000;
   font-size:28px;
   line-height:125%;
}
Why Bother with Alt Text?

 ‣Screenreaders read filenames when no alt attribute
 ‣Text-only browsers/devices benefit
 ‣Image links have anchor text/context
 ‣Google indexes alt text
 ‣Sometimes your CDN goes down
Form Inputs
Associate Inputs with Labels

 ‣Link descriptive text with an input field
 ‣Provides context about what is expected
 ‣Clicking label focuses input field
Implicit vs. Explicit Labels
<label for=”name”>Name</label>
<input type=”text” id=”name”>


<label> Name
  <input type=”text”>
</label>


label { curser: pointer; }
Use Most HTML5 Input Types

 ‣type=”search”
 ‣type=”tel”
 ‣type=”url”
 ‣type=”email”
 ‣Old browsers fallback to type=”text”
Type=”search” Has Slight Benefit




http://css-tricks.com/webkit-html5-search-inputs/
Fieldsets Group Several Inputs
<fieldset id=”contact”>

   <label>
     Name <input type="text">
   </label>
   <label>
      Email <input type="email">
   </label>

</fieldset>
Legend is a Caption for Fieldsets
<fieldset id=”contact”>
  <legend>Contact Info</legend>
   ....
</fieldset
Keyboard Navigation
Turn it on in OSX
System Preferences -> Keyboard -> All Controls
or Press Control + F7
Tab Index

 ‣Use tabindex attribute to specify tab order
 ‣Tab index goes from lowest to highest
 ‣tabindex=”-1” will be skipped
 ‣If you use proper HTML source order, you’re done!
This Site is Gorgeous!




   http://www.hd-live.co.uk/
Pretty Hover State




http://www.hd-live.co.uk/
No Focus State Defined!




http://www.hd-live.co.uk/
:focus = :hover

 ‣Anywhere :hover is used, add :focus as well
a:hover,
a:focus {
  text-decoration:underline;
  color:red;
}
Design for the Outline
a { /* This is bad! */
  outline:0;
}

a:focus { /* Keyboard Users */
  outline: thin dotted #000;
}
a:hover { /* Mouse Users */
  outline:none;
}
Design for the Outline

 ‣Adding outline style is the same as adding a border
 ‣Some elements need 1 or 2 px of padding
 ‣TEST, TEST, TEST!
Hiding Content the Accessible Way
/* Hides from keyboard users */
display:none;


/* Hidden but still accessible */
.hidden {
  left:-999em;
  position:absolute;
  top:auto;
}
Reavling Hidden Content
/* Reveal on Focus */
.hidden:focus {
  position:static;
}
Skip Navigation Link

 ‣Lets a visitor skip straight to the content
 ‣Without it, keyboard visitors suffer
 ‣Should be the first element after <body>
 ‣Can be visible or hidden based on the desgin
 ‣If hidden, should stand out on focus
Skip Navigation Link
<body>
  <a id="top" href="#content">
  Skip to Content</a>
Skip Navigation Link
#top:focus {
  position:static;
  font-size:1.5em;
  background-color:#FFFFD5;
  display:block;
  font-weight:bold;
  color:#000;
  padding:2px 15px 5px;
}
Screenreaders
Add an Anchor to Search Forms
<form action="/search/#content">
   <label for=”q”>Search</label>
   <input type="search" id=”q”>
   <input type=”submit”
value=”search”>
</form>
Add an Anchor to Search Forms

 ‣Skips visitors straight to the results
 ‣No need for screenreaders to read through nav
ARIA Landmark Roles

 ‣Help define the structure of a document
 ‣Screenreaders can move around different sections
 ‣Just add role attribute to an element
 <div id=”header” role=”banner”>
role=”article”

 ‣Content that makes sense in its own right, such as
  a complete blog post, a comment on a blog, a post
  in a forum, and so on.
role=”banner”

 ‣Site-orientated content, such as the title of the
  page and the logo.
 ‣Header
role=”complementary”

 ‣Supporting content for the main content, but
  meaningful in its own right when separated from the
  main content.
 ‣Aside or sidebar
role=”contentinfo”

 ‣Child content, such as footnotes, copyrights, links
  to privacy statement, links to preferences, and so
  on.
 ‣Footer
role=”main”

 ‣Content that is directly related to or expands on the
  central content of the document.
 ‣Main content container, #content
role=”navigation”

 ‣Content that contains the links to navigate this
  document and/or related documents.
role=”search”

 ‣This section contains a search form to search the
  site.
Mobile
Mobile Stylesheet

 ‣Smartphones handle websites OK

 ‣Dumb phones need a slimmed down stylesheet
 ‣http://perishablepress.com/press/2009/08/02/
  the-5-minute-css-mobile-makeover/
Why should I care?
More Visitors

 ‣The more ways your site can be accessed, the more
  potential visitors.
 ‣More visitors = more traffic
 ‣More traffic = more conversions (sales, ad clicks,
  downloads, whatever)
Happier Visitors

 ‣Users that can find what they’re looking for become
  loyal, repeat visitors.
 ‣Loyalty = word of mouth
 ‣Adds to your brand/reputation
Search Engine Optimization

 ‣Accessible content makes Google Happy!
 ‣Happy Google ranks you better!
 ‣Better Rankings = More Traffic

 ‣Sometimes you need to disguise accessibility with
  SEO to sell it to stakeholders.
The Spirit of the Web

 ‣The Internet is an open platform
 ‣The web wants to be device agnostic
 ‣Different ways to view the same content is what
  makes the Internet a special medium.
It’s the right thing to do!

 ‣At the end of the day, it’s people on the other end
  of your website.
Thank You!
Accessibility Resources
 ‣ http://webaim.org
 ‣ http://diveintoaccessibility.org/
 ‣ http://juicystudio.com/article/examining-wai-aria-document-andmark-
   roles.php
 ‣ http://www.w3.org/standards/webdesign/accessibility
 ‣ http://jfciii.com/

More Related Content

PPT
Mobile Information Architecture
PDF
Web Accessibility Gone Wild (Now Even MORE Wilder!)
PPTX
Introduction to Xamarin.Forms and Lessons Learnt
PPTX
Creating a self hosted wordpress website from scratch
PPTX
Wix tutorial
PDF
Creating a Website with WordPress.org
PPT
Lecture 1: Web Design + Usability
PPTX
Challenges going mobile
Mobile Information Architecture
Web Accessibility Gone Wild (Now Even MORE Wilder!)
Introduction to Xamarin.Forms and Lessons Learnt
Creating a self hosted wordpress website from scratch
Wix tutorial
Creating a Website with WordPress.org
Lecture 1: Web Design + Usability
Challenges going mobile

What's hot (20)

PDF
Setting up a blog with WordPress.com Jan 2014 Class
PPTX
700 posts – 1 menu, organizing a large info site with taxonomies and facets
PPT
Web design save earth
PDF
From a Fireworks Comp to a Genesis Child Theme, Step by Step
PDF
Responsive Design
PPTX
WordPress and Child Themes
PDF
11 essential checks before launching your website
PDF
Writing Maintainable Tests with PageObjects
PPTX
Crawling ecommerce sites – Maria Camanes' top tips from Tea-time SEO
PDF
40 web design trends in 2015
PPT
Website Design Dos and Don’ts for a Successful Online Presence
PPTX
Use Google Docs to monitor SEO by pulling in Google Analytics #BrightonSEO
PPT
Google Suppression Attack Lost Blogging Files
PDF
BrightonSEO - How to use XPath with eCommerce Websites
KEY
WHAT IS HTML5?(20100510)
PPTX
PDF
How to Blog - #ACR14 Social Media Bootcamp
PPT
Xhtml validation
PDF
Developing for Mobile Web
PPTX
Sea 2011 presentation
Setting up a blog with WordPress.com Jan 2014 Class
700 posts – 1 menu, organizing a large info site with taxonomies and facets
Web design save earth
From a Fireworks Comp to a Genesis Child Theme, Step by Step
Responsive Design
WordPress and Child Themes
11 essential checks before launching your website
Writing Maintainable Tests with PageObjects
Crawling ecommerce sites – Maria Camanes' top tips from Tea-time SEO
40 web design trends in 2015
Website Design Dos and Don’ts for a Successful Online Presence
Use Google Docs to monitor SEO by pulling in Google Analytics #BrightonSEO
Google Suppression Attack Lost Blogging Files
BrightonSEO - How to use XPath with eCommerce Websites
WHAT IS HTML5?(20100510)
How to Blog - #ACR14 Social Media Bootcamp
Xhtml validation
Developing for Mobile Web
Sea 2011 presentation
Ad

Similar to Building An Accessible Site from the Ground Up (20)

PDF
Accessibility - A feature you can build
PDF
a11yTO - Web Accessibility for Developers
PDF
Web Accessibility Gone Wild
PDF
Web Accessibility - A feature you can build
PDF
P.S. I love you
PPTX
Web accessibility
PDF
Accessibility - A feature you can build
PDF
How Accessibility Made Me a Better Developer
PDF
Diy accessibility
PPSX
Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...
PPTX
accessibility
PDF
Website Accessibility Workshop
PPTX
Selfish Accessibility — Harbour Front HK
PPTX
Selfish Accessibility — YGLF Vilnius
PPTX
Laughlin Constable Web Accessibility Basics for Web Developers
PPTX
WordPress Accessibility - WordCamp Buffalo 2016
PPTX
Selfish Accessibility — CodeDaze
PPTX
How you can start building accessible websites today (... and why!)
PDF
Web Accessibility Gone Wild
PDF
Web accessibility for developers
Accessibility - A feature you can build
a11yTO - Web Accessibility for Developers
Web Accessibility Gone Wild
Web Accessibility - A feature you can build
P.S. I love you
Web accessibility
Accessibility - A feature you can build
How Accessibility Made Me a Better Developer
Diy accessibility
Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...
accessibility
Website Accessibility Workshop
Selfish Accessibility — Harbour Front HK
Selfish Accessibility — YGLF Vilnius
Laughlin Constable Web Accessibility Basics for Web Developers
WordPress Accessibility - WordCamp Buffalo 2016
Selfish Accessibility — CodeDaze
How you can start building accessible websites today (... and why!)
Web Accessibility Gone Wild
Web accessibility for developers
Ad

More from Russell Heimlich (6)

PDF
Cache Rules Everything Around Me
PDF
stickyHeader.js
PDF
Analytics And You
PDF
Video Captioning on the Web
PDF
Accessibility Lightning Talk
PDF
Charting with Google
Cache Rules Everything Around Me
stickyHeader.js
Analytics And You
Video Captioning on the Web
Accessibility Lightning Talk
Charting with Google

Recently uploaded (20)

PDF
Test slideshare presentation for blog post
PPT
Machine printing techniques and plangi dyeing
PPTX
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
PPTX
HPE Aruba-master-icon-library_052722.pptx
PPTX
Causes of Flooding by Slidesgo sdnl;asnjdl;asj.pptx
PPTX
Complete Guide to Microsoft PowerPoint 2019 – Features, Tools, and Tips"
PDF
UNIT 1 Introduction fnfbbfhfhfbdhdbdto Java.pptx.pdf
PPTX
DOC-20250430-WA0014._20250714_235747_0000.pptx
PPTX
NEW EIA PART B - Group 5 (Section 50).pptx
PPTX
YV PROFILE PROJECTS PROFILE PRES. DESIGN
PDF
ART & DESIGN HISTORY OF VEDIC CIVILISATION.pdf
PDF
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
PDF
intro_to_rust.pptx_123456789012446789.pdf
DOCX
A Contemporary Luxury Villa in Dubai Jumeirah-2.docx
PPTX
Media And Information Literacy for Grade 12
PDF
Interior Structure and Construction A1 NGYANQI
PDF
Emailing DDDX-MBCaEiB.pdf DDD_Europe_2022_Intro_to_Context_Mapping_pdf-165590...
PDF
Key Trends in Website Development 2025 | B3AITS - Bow & 3 Arrows IT Solutions
PDF
Facade & Landscape Lighting Techniques and Trends.pptx.pdf
PDF
YOW2022-BNE-MinimalViableArchitecture.pdf
Test slideshare presentation for blog post
Machine printing techniques and plangi dyeing
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
HPE Aruba-master-icon-library_052722.pptx
Causes of Flooding by Slidesgo sdnl;asnjdl;asj.pptx
Complete Guide to Microsoft PowerPoint 2019 – Features, Tools, and Tips"
UNIT 1 Introduction fnfbbfhfhfbdhdbdto Java.pptx.pdf
DOC-20250430-WA0014._20250714_235747_0000.pptx
NEW EIA PART B - Group 5 (Section 50).pptx
YV PROFILE PROJECTS PROFILE PRES. DESIGN
ART & DESIGN HISTORY OF VEDIC CIVILISATION.pdf
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
intro_to_rust.pptx_123456789012446789.pdf
A Contemporary Luxury Villa in Dubai Jumeirah-2.docx
Media And Information Literacy for Grade 12
Interior Structure and Construction A1 NGYANQI
Emailing DDDX-MBCaEiB.pdf DDD_Europe_2022_Intro_to_Context_Mapping_pdf-165590...
Key Trends in Website Development 2025 | B3AITS - Bow & 3 Arrows IT Solutions
Facade & Landscape Lighting Techniques and Trends.pptx.pdf
YOW2022-BNE-MinimalViableArchitecture.pdf

Building An Accessible Site from the Ground Up

  • 1. Building An Accessible Site from the Ground Up
  • 2. Russell Heimlich @KingKool68 ‣Web Developer at the Pew Research Center ‣http://www.russellheimlich.com/blog
  • 3. I Like Funny T-Shirts
  • 4. What is accessibility? http://www.flickr.com/photos/artbystevejohnson/4610457832/
  • 5. Accessibility is NOT just about people with disabilities.
  • 6. Accessibility is about PEOPLE! http://www.flickr.com/photos/elvire-r/2451784799/
  • 7. Devices ‣Desktop Computer ‣Mobile ‣In Between (iPad, Netbooks) ‣TV’s http://www.flickr.com/photos/krossbow/4757275301/
  • 8. Interactions ‣Mouse ‣Keyboard ‣Touchscreen ‣Screenreader http://www.flickr.com/photos/a6u571n/3207185886/
  • 9. Technologies ‣JavaScript ‣CSS ‣Images display: none;
  • 10. So what can be done to make websites more accessible?
  • 12. Use the Right Element for the Job <p> = paragraph <h1>-<h6> = Heading 1 through 6 <div class=”paragraph”> Using Tables for Layout
  • 13. Be Aware of the Source Order ‣Markup content the way it should be read NOT the way it should be displayed. Header Header Aside Content Content Aside
  • 14. Create Consistent Conventions <div id=”header”> <ul id=”nav”> <div id=”content”> <div id=”sidebar”> <div id=”footer”>
  • 15. Use Alt Attributes on <img> ‣Include text to display as a backup ‣Provide context to what the user is missing ‣If the image is purely decoration use alt=””
  • 16. Style Alt Text a img { background-color:#EDEBD5; border:medium none; color:#000; font-size:28px; line-height:125%; }
  • 17. Why Bother with Alt Text? ‣Screenreaders read filenames when no alt attribute ‣Text-only browsers/devices benefit ‣Image links have anchor text/context ‣Google indexes alt text ‣Sometimes your CDN goes down
  • 19. Associate Inputs with Labels ‣Link descriptive text with an input field ‣Provides context about what is expected ‣Clicking label focuses input field
  • 20. Implicit vs. Explicit Labels <label for=”name”>Name</label> <input type=”text” id=”name”> <label> Name <input type=”text”> </label> label { curser: pointer; }
  • 21. Use Most HTML5 Input Types ‣type=”search” ‣type=”tel” ‣type=”url” ‣type=”email” ‣Old browsers fallback to type=”text”
  • 22. Type=”search” Has Slight Benefit http://css-tricks.com/webkit-html5-search-inputs/
  • 23. Fieldsets Group Several Inputs <fieldset id=”contact”> <label> Name <input type="text"> </label> <label> Email <input type="email"> </label> </fieldset>
  • 24. Legend is a Caption for Fieldsets <fieldset id=”contact”> <legend>Contact Info</legend> .... </fieldset
  • 26. Turn it on in OSX System Preferences -> Keyboard -> All Controls or Press Control + F7
  • 27. Tab Index ‣Use tabindex attribute to specify tab order ‣Tab index goes from lowest to highest ‣tabindex=”-1” will be skipped ‣If you use proper HTML source order, you’re done!
  • 28. This Site is Gorgeous! http://www.hd-live.co.uk/
  • 30. No Focus State Defined! http://www.hd-live.co.uk/
  • 31. :focus = :hover ‣Anywhere :hover is used, add :focus as well a:hover, a:focus { text-decoration:underline; color:red; }
  • 32. Design for the Outline a { /* This is bad! */ outline:0; } a:focus { /* Keyboard Users */ outline: thin dotted #000; } a:hover { /* Mouse Users */ outline:none; }
  • 33. Design for the Outline ‣Adding outline style is the same as adding a border ‣Some elements need 1 or 2 px of padding ‣TEST, TEST, TEST!
  • 34. Hiding Content the Accessible Way /* Hides from keyboard users */ display:none; /* Hidden but still accessible */ .hidden { left:-999em; position:absolute; top:auto; }
  • 35. Reavling Hidden Content /* Reveal on Focus */ .hidden:focus { position:static; }
  • 36. Skip Navigation Link ‣Lets a visitor skip straight to the content ‣Without it, keyboard visitors suffer ‣Should be the first element after <body> ‣Can be visible or hidden based on the desgin ‣If hidden, should stand out on focus
  • 37. Skip Navigation Link <body> <a id="top" href="#content"> Skip to Content</a>
  • 38. Skip Navigation Link #top:focus { position:static; font-size:1.5em; background-color:#FFFFD5; display:block; font-weight:bold; color:#000; padding:2px 15px 5px; }
  • 40. Add an Anchor to Search Forms <form action="/search/#content"> <label for=”q”>Search</label> <input type="search" id=”q”> <input type=”submit” value=”search”> </form>
  • 41. Add an Anchor to Search Forms ‣Skips visitors straight to the results ‣No need for screenreaders to read through nav
  • 42. ARIA Landmark Roles ‣Help define the structure of a document ‣Screenreaders can move around different sections ‣Just add role attribute to an element <div id=”header” role=”banner”>
  • 43. role=”article” ‣Content that makes sense in its own right, such as a complete blog post, a comment on a blog, a post in a forum, and so on.
  • 44. role=”banner” ‣Site-orientated content, such as the title of the page and the logo. ‣Header
  • 45. role=”complementary” ‣Supporting content for the main content, but meaningful in its own right when separated from the main content. ‣Aside or sidebar
  • 46. role=”contentinfo” ‣Child content, such as footnotes, copyrights, links to privacy statement, links to preferences, and so on. ‣Footer
  • 47. role=”main” ‣Content that is directly related to or expands on the central content of the document. ‣Main content container, #content
  • 48. role=”navigation” ‣Content that contains the links to navigate this document and/or related documents.
  • 49. role=”search” ‣This section contains a search form to search the site.
  • 51. Mobile Stylesheet ‣Smartphones handle websites OK ‣Dumb phones need a slimmed down stylesheet ‣http://perishablepress.com/press/2009/08/02/ the-5-minute-css-mobile-makeover/
  • 52. Why should I care?
  • 53. More Visitors ‣The more ways your site can be accessed, the more potential visitors. ‣More visitors = more traffic ‣More traffic = more conversions (sales, ad clicks, downloads, whatever)
  • 54. Happier Visitors ‣Users that can find what they’re looking for become loyal, repeat visitors. ‣Loyalty = word of mouth ‣Adds to your brand/reputation
  • 55. Search Engine Optimization ‣Accessible content makes Google Happy! ‣Happy Google ranks you better! ‣Better Rankings = More Traffic ‣Sometimes you need to disguise accessibility with SEO to sell it to stakeholders.
  • 56. The Spirit of the Web ‣The Internet is an open platform ‣The web wants to be device agnostic ‣Different ways to view the same content is what makes the Internet a special medium.
  • 57. It’s the right thing to do! ‣At the end of the day, it’s people on the other end of your website.
  • 59. Accessibility Resources ‣ http://webaim.org ‣ http://diveintoaccessibility.org/ ‣ http://juicystudio.com/article/examining-wai-aria-document-andmark- roles.php ‣ http://www.w3.org/standards/webdesign/accessibility ‣ http://jfciii.com/