SlideShare a Scribd company logo
1 of 70
Keyboard  accessibility BASIC STEPS TOWARDS A MORE USABLE AND ACCESSIBLE SITE Patrick H. Lauke / Future of Web Design Tour / Glasgow / 14 September 2009
accessibility  = blind users + screenreaders?
difficult to test – need to install and learn  screenreader
many different forms of disability
keyboard or keyboard-like interfaces
easiest to test…no special software required
 
 
by default users  TAB
 
using keyboard, move from one focusable element to the next
standard focusable elements: links ,  form elements ,  image map areas
 
 
 
 
 
don’t forget the  fancy styling
 
a.action :hover  { background-color:#a82310; color:#fff !important; text-decoration:none; } #promo-dvd .content a :hover  img { background-color:#d5c7ae; }
a :focus , a :hover , a :active  { … }
don’t suppress  outline !
 
keyboard accessible, but where am I?
/* =Reset Styles -  Thank you Eric Meyer  ( http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ ) */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } :focus  { outline: 0; }
/* remember to define focus styles! */
why do designers suppress outline?
 
“ get your outline out of my design!” … is there a  compromise ?
 
 
a { …  overflow: hidden ;  }
 
… only suppress it on  :active
TAB  cycle – normally just  source order
tabindex  forces a certain  TAB  cycle
anything with  tabindex  takes precedence
 
<input type=&quot;text&quot; name=&quot;author&quot;… tabindex=&quot;1&quot;  /> <input type=&quot;text&quot; name=&quot;email&quot;… tabindex=&quot;2&quot;  /> <input type=&quot;text&quot; name=&quot;url&quot;… tabindex=&quot;3&quot;  /> <textarea name=&quot;comment&quot;… tabindex=&quot;4&quot; ></textarea>
easy enough…let’s drop in some JavaScript
 
 
keyboard accessible, but  where’s the extra information ?
$('#whatever') .hover ( function() {…}, function() {…} );
$('#whatever') .hover ( function() {…}, function() {…} ); $('#whatever') .focus (function() {…}); $('#whatever') .blur (function() {…} );
aside:  mobile browsers  don’t do hover  (well)
lightboxes …we love ’em
 
close it again on  TAB don’t invent new keyboard shortcuts
more complex solution:  manage focus
and now, the dangerous part…
JavaScript attaches behaviour to  anything
$(' div ') .click (function() {…} );
sexy tutorials out there doing it wrong
 
be lazy …use libraries that solved this YUI, jQueryUI, etc
beware  3 rd  party solutions even the big boys can get it wrong
 
 
 
hijack generated markup to  accessify  it
in conclusion…
if you style  :hover , also  :focus  and  :active
don’t suppress  outline  completely (reintroduce  :focus  and suppress  :active )
leave  tabindex  alone – source order
JavaScript on  hover  (mouseover/mouseout) also on  focus / blur (if focusable element)
lightboxes  and their problems
only attach behaviour to  focusable elements
</ rant >
www.opera.com/developer [email_address]

More Related Content

Viewers also liked (6)

Trading-Area Analysis
Trading-Area AnalysisTrading-Area Analysis
Trading-Area Analysis
 
Berman Rm10 Ppt 03
Berman Rm10 Ppt 03Berman Rm10 Ppt 03
Berman Rm10 Ppt 03
 
Wipro Media Q1 0809
Wipro Media Q1 0809Wipro Media Q1 0809
Wipro Media Q1 0809
 
4retal instbyownrship
4retal instbyownrship4retal instbyownrship
4retal instbyownrship
 
retailing-customer loyalty
retailing-customer loyaltyretailing-customer loyalty
retailing-customer loyalty
 
Chapter 7 retail locations ppt
Chapter 7 retail locations pptChapter 7 retail locations ppt
Chapter 7 retail locations ppt
 

Similar to keyboard accessibility

Future proofing design work with Web components
Future proofing design work with Web componentsFuture proofing design work with Web components
Future proofing design work with Web components
btopro
 
ooc - A hybrid language experiment
ooc - A hybrid language experimentooc - A hybrid language experiment
ooc - A hybrid language experiment
Amos Wenger
 

Similar to keyboard accessibility (20)

Keyboard accessibility - basic steps towards a more usable and accessible sit...
Keyboard accessibility - basic steps towards a more usable and accessible sit...Keyboard accessibility - basic steps towards a more usable and accessible sit...
Keyboard accessibility - basic steps towards a more usable and accessible sit...
 
Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3
 
Look ma! No images!
Look ma! No images!Look ma! No images!
Look ma! No images!
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
Keyboard accessibility - just because I don't use a mouse doesn't mean I'm se...
Keyboard accessibility - just because I don't use a mouse doesn't mean I'm se...Keyboard accessibility - just because I don't use a mouse doesn't mean I'm se...
Keyboard accessibility - just because I don't use a mouse doesn't mean I'm se...
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATS
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
 
Introduction To JSFL
Introduction To JSFLIntroduction To JSFL
Introduction To JSFL
 
Twig for Drupal 8 and PHP | Presented at OC Drupal
Twig for Drupal 8 and PHP | Presented at OC DrupalTwig for Drupal 8 and PHP | Presented at OC Drupal
Twig for Drupal 8 and PHP | Presented at OC Drupal
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
SharePoint Saturday NYC - SharePoint and jQuery, what I wish I would have kno...
SharePoint Saturday NYC - SharePoint and jQuery, what I wish I would have kno...SharePoint Saturday NYC - SharePoint and jQuery, what I wish I would have kno...
SharePoint Saturday NYC - SharePoint and jQuery, what I wish I would have kno...
 
OOScss Architecture For Rails Apps
OOScss Architecture For Rails AppsOOScss Architecture For Rails Apps
OOScss Architecture For Rails Apps
 
PyData NYC 2019
PyData NYC 2019PyData NYC 2019
PyData NYC 2019
 
Shoes
ShoesShoes
Shoes
 
Building for Accessibility
Building for AccessibilityBuilding for Accessibility
Building for Accessibility
 
Future proofing design work with Web components
Future proofing design work with Web componentsFuture proofing design work with Web components
Future proofing design work with Web components
 
ooc - A hybrid language experiment
ooc - A hybrid language experimentooc - A hybrid language experiment
ooc - A hybrid language experiment
 
ooc - A hybrid language experiment
ooc - A hybrid language experimentooc - A hybrid language experiment
ooc - A hybrid language experiment
 
Quick tips for porting your iOS designs to Android
Quick tips for porting your iOS designs to AndroidQuick tips for porting your iOS designs to Android
Quick tips for porting your iOS designs to Android
 
Dart
DartDart
Dart
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

keyboard accessibility

Editor's Notes

  1. If you’re using OS X, make sure you enable full keyboard access for all controls in your system preferences under Keyboard &amp; Mouse settings.
  2. In Safari (both in OS X and Windows) you need to also explicitly set “Press Tab to highlight each item on a webpage”) in your Advanced preferences.
  3. Opera has a slightly different keyboard control scheme – instead of using TAB, you use CTRL + cursor arrows up/down to move to the previous/next link. There is also a different mode, Spatial Navigation, which behaves very differently and is beyond the scope of this presentation (mainly as it actually behaves more like a mouse, thus removing all requirements outlined in this presentation…but we don’t advocate designing just for Opera, of course).
  4. IE’s link outline is the classic dotted line. The colour of this line seems to depend on the background colour(s) used.
  5. Firefox uses the dotted outline – the colour matches the link colour set for the focused link.
  6. Safari uses a large blue box around the link.
  7. Google Chrome uses an orange-ish box around links to highlight them.
  8. Opera uses both a blue box and highlights the text of the link with its default selection colour.
  9. Andy’s “for a beautiful web” site is nicely keyboard accessible. A few details – mainly eye candy – only appear when using a mouse, however: the “sign up” buttons change colour and the DVD boxes get a lighter outline on hover.
  10. Paul’s “boagworld” suppresses any outline completely, making it impossible to know where a keyboard user is within the page. The problem is exacerbated in browsers that either don’t have a status bar (such as Google Chrome) or which for some reason don’t show the link target when using the keyboard (Safari).
  11. Many people using Eric’s reset.css seem to overlook (or simply ignore) this little warning in the original code…
  12. Carsonified.com is beautifully art-directed and designed, with lots of image replacement. Again, because of Eric Meyer’s reset.css, outlines and :focus styles are completely suppressed though.
  13. Carsonified makes extensive use of image replacement. Forcing the focus outline to be visible shows that, in one instance – the “Follow us on Twitter” button – the outline betrays the “off-left” CSS image replacement that was used, by going off to the left of the window…an ugly effect that designers just won’t stand for!
  14. An intial quick fix to Carsonified would be to add overflow:hidden to the twitter button. Now, at least, the outline remains contained around the image-replaced link and doesn’t go off to the left of the page.
  15. Being a boring pedant, I tried all sorts of variations (removing outline altogether, reintroducing it on focus, removing it again on active, etc) to try and find an acceptable solution that lets keyboard users still see the outline, but that doesn’t trigger the outline when users click on image-replaced links.
  16. The default Wordpress theme’s comment form has tabindices on all fields. No matter how many links there are on the page or in the actual blog post, a keyboard user coming to the page and hitting TAB for the first time is bounced straight to the comment form…not very useful if they haven’t even read the blog post yet!
  17. jQuery’s homepage has three links in its central section, which all have informative “fancy tooltips” springing up on mouse hover. These tooltips give information not immediately available on the page. Sadly, they don’t come up for keyboard users.
  18. Paul’s “boagworld” again…this time, we look at the “latest shows” section on the right. Moving the mouse over each show expand “boagworld’s magic hover accordion” thing to present the show’s synopsis. This makes people seasick, including myself…but it only triggers on mouseover. Why not make keyboard users just as sick and give them the same information immediately?
  19. Lokesh Dhakar’s Lightbox JS is one of the first lightbox scripts I remember coming across many years ago. It works fine via keyboard – TAB to the thumbnail, activate it, and the lightbox appears. Now, TAB again…the lightbox remains on screen, and you’re tabbing behind the dimmed background layer. The lightbox does say “press X to close”, but this isn’t immediately helpful. If it’s already listening out for “X” why not also listen out for TAB?
  20. Particularly important if you’re using a “thickbox”, i.e. a lightbox that contains more than just an image and some text. Use JavaScript to place the focus inside the box, so keyboard users can get to the thickbox’s content (links etc). When they close the box, programmatically focus them back on the link/thumbnail that activated the box in the first place (closures?)
  21. WebDesignerWall’s jQuery tutorials for designers are really great. The whole site sports a beautiful design, so I’m not “slagging” it. However, the examples it shows are of the worst kind: buttons, accordions, etc all feature &lt;div&gt; elements and such with onclick behaviours…completely keyboard inaccessible.
  22. A look under the hood of the markup that Google Maps spits out shows that the controls are nothing more than one big image with invisible &lt;div&gt; elements placed over it, all with onclick behaviours to face actual buttons. Why does Google not simply generate &lt;button&gt; elements, as would be semantically appropriate and keyboard accessible?
  23. My Dev.Opera article shows how – in a kludged way – the Google Maps markup can be hijacked and the &lt;div&gt; elements replaced with actual &lt;button&gt; elements. Note that since the article was published, Google seem to have further modified their markup, breaking one aspect of my interim solution…one more reason why we should really lobby Google to actually fix the problem at source.