Common Accessibility Mistakes

17
Are you still doing that?!?! Common Accessibility Errors Ted Drake Yahoo! Accessibility Lab Monday, March 28, 2011

description

This presentation covers accessibility mistakes that are still commonly made. It was created for an internal Yahoo event for front-end engineers to share best practices.

Transcript of Common Accessibility Mistakes

Page 1: Common Accessibility Mistakes

Are you still doing that?!?!Common Accessibility Errors

Ted DrakeYahoo! Accessibility Lab

Monday, March 28, 2011

Page 2: Common Accessibility Mistakes

Contrast

Yahoo! Accessibility Lab Accessibility.Yahoo.Com | @yahooaccess | Facebook.com/YahooAccessibility

Monday, March 28, 2011

Make sure web sites have enough contrast http://snook.ca/technical/colour_contrast/colour.html

Page 3: Common Accessibility Mistakes

Red

Yahoo! Accessibility Lab Accessibility.Yahoo.Com | @yahooaccess | Facebook.com/YahooAccessibility

Green

click on the red button

Monday, March 28, 2011

Don’t use color as the only delimiter. Finance uses color + arrows.Yahoo! sites are pretty good at doing this correctlyred and green are the same color for those that are color blind.

Page 4: Common Accessibility Mistakes

Lady Gaga stuns the Grammys

Monday, March 28, 2011

Image from Getty Images

Page 5: Common Accessibility Mistakes

Lady Gaga performs “Born This Way” while emerging from a large egg-shaped

pod

Yahoo! Accessibility Lab Accessibility.Yahoo.Com | @yahooaccess | Facebook.com/YahooAccessibility

Lady Gaga stuns the Grammys

Monday, March 28, 2011

This is appropriate alt text

Page 7: Common Accessibility Mistakes

Lady Gaga stuns the Grammys

Yahoo! Accessibility Lab Accessibility.Yahoo.Com | @yahooaccess | Facebook.com/YahooAccessibility

Lady Gaga stuns the Grammys

Monday, March 28, 2011

It doesn’t help to duplicate the headline in the image.Try placing them in the same link and use alt=””

Page 8: Common Accessibility Mistakes

Yahoo! Accessibility Lab Accessibility.Yahoo.Com | @yahooaccess | Facebook.com/YahooAccessibility

Lady Gaga stuns the Grammys

Monday, March 28, 2011

alt=”” is ignored by screen reader.Good for decorative imagesGood for images within a link that has descriptive textNot good for content images by themselvesrole=”presentation” will tell screenreaders to ignore the image

Page 9: Common Accessibility Mistakes

Images Disabled

Yahoo! Accessibility Lab Accessibility.Yahoo.Com | @yahooaccess | Facebook.com/YahooAccessibility

Monday, March 28, 2011

add a background color to your background CSS when the link text is the same color as the container background color. This can cause problems with transparent images using rounded corners.

Page 10: Common Accessibility Mistakes

Off-screen TextYahoo! Accessibility Lab Accessibility.Yahoo.Com | @yahooaccess | Facebook.com/YahooAccessibility

The mother of all scroll bars

<html dir=”rtl”>

Monday, March 28, 2011

using position:absolute; left:-999em to create off-screen text generates huge scroll bars when switched to rtl text direction

Page 11: Common Accessibility Mistakes

Use Clip

.visually-hidden { position: absolute !important; clip: rect(1px 1px 1px 1px); /* IE6, 7 */ clip: rect(1px, 1px, 1px, 1px);}

Yahoo! Accessibility Lab Accessibility.Yahoo.Com | @yahooaccess | Facebook.com/YahooAccessibility

Yahoo! Accessibility LibraryClip your hidden content for better accessibility

Monday, March 28, 2011

This rule tells us to position the element absolutelythen only show the top left pixel.http://yaccessibilityblog.com/library/css-clip-hidden-content.htmlbackground images disapear in high contrast or MS optimization mode. Inline images can be safer.

Page 12: Common Accessibility Mistakes

Some rights reserved by Marcin Wichary on FlickrMonday, March 28, 2011

Don’t forget keyboard accessibility

Page 13: Common Accessibility Mistakes

:hover, :focus, :active

Monday, March 28, 2011

Don’t remove focus and active styles without providing an alternative.onclick is the only event that is supported by keyboard as well as mouse users

Page 14: Common Accessibility Mistakes

<bu$on>Sign  In</bu$on>  

<a>Cancel</a>  

Yahoo! Accessibility Lab Accessibility.Yahoo.Com | @yahooaccess | Facebook.com/YahooAccessibility

Monday, March 28, 2011

Don’t use a link for a button.at least add role=”button”you can style a button to look like a link for UED

Page 15: Common Accessibility Mistakes

Command +Is not testing for text size flexibility

Yahoo! Accessibility Lab Accessibility.Yahoo.Com | @yahooaccess | Facebook.com/YahooAccessibility

Monday, March 28, 2011

In firefox and safari choose view->zoom text only, then use command +Also test by setting a larger text size in your browser preferences

Page 16: Common Accessibility Mistakes

Buckle it up

<label for=”p”>Search Yahoo! Foo</label><input id=”p” name=”p” type=”text”>

<label for=”p”>Search the web</label><input id=”p” name=”p” type=”text”>

Monday, March 28, 2011

implicit binding of label and input does not work in IE6.Buckle + Belt is fine.Make sure you don’t duplicate input id’s on the same page.Test your forms with a screenreader. Using an image with alt within the label was found to not work.

Page 17: Common Accessibility Mistakes

Visit our code libraryAccessibility.Yahoo.Com/library/

Yahoo! Accessibility Lab Accessibility.Yahoo.Com | @yahooaccess | Facebook.com/YahooAccessibility

Monday, March 28, 2011

Visit the Yahoo! Accessibility Lab’s code library to find best practices for accessibility.