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
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!
: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;
}
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
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.
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/
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.