Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Designing for Accessibility 619

22


Take Advantage of All HTML Tags


It’s easy to fall into the trap of using or rather than more specific tags when you
need to add emphasis to something. For example, suppose you’re citing a passage from
a book. When you enter the book title, you could indicate to your users that it’s a proper
title by putting it inside the tag, or you could use the tag. There are plenty of
other underutilized tags, as well, all of which provide some semantic meaning in addition
to the text formatting they’re associated with.


Even in cases in which you really just want to emphasize text, it’s preferable to use
and over and . These tags provide a lot more meaning than the basic
text formatting tags that are often used. Not all alternative browsers will take advantage
of any or all of these tags, but conveying as much meaning as possible through your
choice of tags won’t hurt accessibility for sure, and will help some now and could help
more in the future. There’s no downside to taking this approach, either.


Frames


Frames are, to put it bluntly, not accessible. That is why they were removed from
HTML5. This doesn’t exactly apply to inline frames, but they are still difficult for most
AT to use. This is especially true if you put an entirely different site inside your iframe.
In this case, the site you’re framing needs to be accessible as well, and that’s not a guar-
antee. My recommendation is to avoid even inline frames unless you absolutely must use
them, and provide alternative content—like links to the framed content—when you do.


Forms


Forms present another thorny accessibility issue. Nearly all web applications are based on
forms, and failure to make them accessible can cost you users. For example, large online
stores have a serious financial interest in focusing on form accessibility. How many sales
would Amazon or eBay lose if their sites weren’t accessible? Some work on making sure
the forms that enable you to purchase items are accessible can really pay off.


One key thing to remember is that disabled users often navigate using only the keyboard.
As I mentioned when talking about links, assigning sensible tabindex values to your
form fields can really increase both the usability and the accessibility of your forms. The
other advanced form tags, such as fieldset, optgroup, and label, can be beneficial in
terms of usability, too.