Sorcerer's Isle

Accessibility Is Not CSS!

The biggest barrier to creating an accessible Internet is not browser support or badly designed syntax, but rather people's false beliefs of what accessibility is; what it means to 'be accessible'. For many people, being accessible means switching from font tags to CSS, using em tags for italics, and replacing tables with divs. THAT IS NOT ACCESSIBILITY!

Accessibility has nothing to do with stylesheets; indeed it can be seen specifically as creating pages that will display sensibly without stylesheets. Creating an accessible page means using tags that give appropriate meaning to the content they enclose, and that is not done by blinding replacing <i>italics</i> with <em>emphasis</em>, or changing from a grid layout to a meaningless mess of divs.

Creating an accessible page means your code should make complete sense without style tags or attributes.

The purpose of accessibility is to ensure that a page maintains the meaning that the writer intended, regardless of how the page is output. It is not about simply complying with standards, graceful degradation, etc - it is about ensuring the contents of the page makes sense to all its readers.

I will repeat myself once more to help clarify the point I am trying to make:

Accessibility is using correct markup to convey clear meaning which makes complete sense to everyone no matter what method is used to consume the contents.

To help illustrate this, here are three examples of the same form. The first is coded using traditional misused table tags to produce a grid layout. The second is simply a conversion of this into divs, which makes the layout more flexible but is no more accessible. Finally we have an example of one way to create accessibility, with the markup providing clear information about what each part of the form is.


<form action="somepage.html" method="post"> <table border="0" cellspacing="0"> <tr> <td colspan="2">Personal Details</td> </tr> <tr> <td colspan="2"></td> </tr> <tr> <td><b>Name</b></td> <td> <input type="text" name="name"/> </td> </tr> <tr> <td colspan="2"><font size="1">Please provide your name so we know what to call you.</font></td> </tr> <tr> <td>Age</td> <td> <input type="checkbox" name="age" value="-17"/> 0-17 <input type="checkbox" name="age" value="18-30"/> 18-30 <input type="checkbox" name="age" value="31-64"/> 31-64 <input type="checkbox" name="age" value="65+"/> 65+ </td> </tr> <tr> <td colspan="2"><font size="1"><i>this field is optional</i></font></td> </tr> <tr> <td><b>Location</b></td> <td> <input type="text" name="location"/> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"></td> </tr> <tr> <td colspan="2"> <input type="submit" value="ok"/> <input type="reset" value="cancel"/> </td> </tr> </table> </form>
<form action="somepage.html" method="post"> <div class="formSection">Personal Details</div> <div class="formField"> <div class="formLabel"><strong>Name</strong></div> <input type="text" name="name"/> </div> <div class="formHint"> <small>Please provide your name so we know what to call you.</small> </div> <div class="formField"> <div class="formLabel">Age</div> <input type="checkbox" name="age" value="-17"/> 0-17 <input type="checkbox" name="age" value="18-30"/> 18-30 <input type="checkbox" name="age" value="31-64"/> 31-64 <input type="checkbox" name="age" value="65+"/> 65+ </div> <div class="formHint"> <small><em>this field is optional</em></small> </div> <div class="formField"> <div class="formLabel"><strong>Location</strong></div> <input type="text" name="location"/> </div> <br/> <div class="formControls"> <input type="submit" value="ok"/> <input type="reset" value="cancel"/> </div> </form>
<form action="somepage.html" method="post"> <fieldset class="std"> <legend>Personal Details</legend> <div class="required field"> <label class="indiv header" for="name">Name</label> <input type="text" name="name" id="name"/> <small class="hint">Please provide your name so we know what to call you.</small> </div> <div class="optional field"> <label class="header" for="age">Age</label> <input type="checkbox" name="age" id="age_0017" value="-17"/> <label class="indiv" for="age_0017">0-17</label> <input type="checkbox" name="age" id="age_1830" value="18-30"/> <label class="indiv" for="age_1830">18-30</label> <input type="checkbox" name="age" id="age_3164" value="31-64"/> <label class="indiv" for="age_3164">31-64</label> <input type="checkbox" name="age" id="age_6599" value="65+"/> <label class="indiv" for="age_6599">65+</label> </div> <div class="required field"> <label class="indiv header" for="location">Location</label> <input type="text" name="location" id="location"/> </div> </fieldset> <fieldset class="controls"> <input type="submit" value="ok"/> <input type="reset" value="cancel"/> </fieldset> </form>

DISCLAIMER: I am not claiming this final example is perfect, but it is hopefully sufficient to demonstrate what I've been saying


By using accessibility we are making it easier for people to understand our content, regardless of their method of accessing that content. And if that isn't motivation enough, making your pages accessible will greatly improve your search engine rankings too.

I do hope that this piece has been useful - if you have any questions or thoughts on the matter please do leave a comment below, or feel free to e-mail me directly on blog:bpsite.net

Posted:
15 September 2006, 21:05
Tags:
Accessibility
User Interface
Web Development

There have been 11 comments.

me @ 2007-Jan-03 17:57
Only a freak can make a post about accesibility with light letters and dark background, and the comic sans sucks
Peter @ 2007-Jan-10 13:49
What is inaccessible about white on black? It is perfectly readable, and can be easily updated in browser settings if the user chooses.
FWIW, the next design of this page, which I'm working on at the moment, will have completely customisable background and foreground colours, with a default of bright red against lime background.

The comic sans is irony.
Jon Doe @ 2007-Jan-27 20:47
Just testing.
Upset with stupid people @ 2007-Jul-02 08:06
To the first commenter, you're a moron. For most visually impaired, high contrast such as seen on this page is actually good.
Ash @ 2008-Jan-28 09:21
I agree, commenter 1 needs to find out what he/her is talking about! White text on a dark background is not only higher contrast (better for visually impared) but its also easier on the eye for every one else as the whole screen is less bright.

If i had to read 100 screens without printing, i'd rather black bg and white text!
H5N1 @ 2008-Mar-15 16:25
In the accessibility guide lines the CODE in wich you develop a document is supposed to be standard-compliant.
This article makes sense only if you're talking about the obsolete HTML 4.01 standard.
In other cases (Transitional languages are for freaks and rookies) you MUST use non-inline-styles for aderence with webstandards.
You cannot talk about accessibility w/o talking about standards.
Accessibility is not an optional.
Ash @ 2008-Jan-28 09:23
Ps. you need to fix your "add coment" page, delete my second post, and get yourself a pc as they're much cheaper (although not as easy on the eye :p )
Peter @ 2008-Feb-02 22:39
I've got a PC. :P
Peter @ 2008-Feb-02 22:49
And thanks for the heads-up on the comment problem - should be fixed now.
Peter @ 2008-Feb-02 23:06
(As is the bug that reared it's head after fixing that problem; I've got to get myself off of this useless software.)
Peter @ 2008-Mar-15 17:12

This applies regardless of which HTML version you're using.

HTML 4.01 is not yet obsolete; HTML 5 is still in planning/draft stages.
(XHTML1 is not a replacement for HTML4, it is a reformulation of it into an XML application.)

All that aside, nowhere is anyone suggesting using inline styles.

Registered Members
If unregistered, leave blank.
If unregistered, leave blank.
Unregistered Guests
Identifies your comment
Not displayed publically. Allows new comment notifications, or for the blog owner to contact you.
Link your name back to your personal website.
Comment