Eriginal [:-) Building a Website in XHTML 1.0 | Article 1.4 |
Article 1.4 | ||||||
"The internet, is that thing still around?" Homer Simpson | ||||||
|
Introduction: Accessibility
When designing a web page you should aim to build it so the content is accessible to the broadest range of people. In this article we will look at a number of ways you can write your underlying code to make it more accessible for people with different abilities.
Relative Sizes
The size of this text is defined in pixels so can't be resized This text can be resized. The controls below simulate the effect of using the text size menu in your browser to increase or decrease the text size. Choose either to see the effect on the text above. With a visual impairment a user might not be able to read the content on your site if they can't resize the text. Everyone, irrespective of their physical condition, should be able to access your content. Use relative font sizes to accomplish this, do not define your text size in pixels. You could use the following intervals in your CSS style sheets to define your text sizes to ensure browsers are able to resize the default font size you use.
xx-small
xx-small x-small small medium large x-large xx-large In your CSS the font size would be written as follows, where you want to set a default size for most of your page elements.
body, p, td, div, li
{ font-size: x-small; font-family: Arial, Verdana, Helvetica, monospace; colour: #000000; } Using relative sizing in your font size definitions is the single most important attribute you can add to your site to improve its accessibility.
The "alt" Attribute
If the image you are using conveys additional, important information you should also include the "longdesc" attribute to describe that information so it is available to text readers. Lets look at an example. The image on the left conveys a lot of information a user might miss if they didn't have display images switched on or were viewing the page with something other than a computer. The image indicates top level domains, including .com. .co.uk, .org and .net are on sale from £5. Now hover your mouse over the image. The "alt" attribute is displayed so if images are switched off a user will still get the right message. The code looks like this where your image is located in "images/domains.jpg" in your site directory.
<img border="0" src="images/domains.jpg" width="78" height="96" alt="Click here to buy domains from £5"
longdesc="Top level domains, including .com, .co.uk, .org and .net are on sale from £5" />
Using CSS and the div tag to control display
You should use CSS and divs to control layout rather than tables. Tables are easy to manipulate but they should be used to display data rather than content. A typical page design uses a three column table, but this can be easily replicated without using tables. Lets look at how. The example below uses a table to display content.
Now we can replicate this design using a div as per below
Column 1 content
Column 2 content
Column 3 content
In table design we would have used colspan or rowspan to merge cells together to, for instance, create a header or footer in our page design. Again this can be easily accomplished with CSS and the div tag.
This is the content in the header section
Column 1 content
Column 2 content
Column 3 content
This is the content in the footer section
Lets look at the code. We'll define six div tags in our style container. Click view at the bottom of this form to see the result. This page is built using divs rather than tables to control the layout. In addition the div tags are sized in relative terms to improve accessibility and the page validates as XHTML. Once you've opened the page resize it to see the changes. Unlike fixed width definitions the divs will resize along with the browser window. Checkpoint 5.3 of the World Wide Web Consortiums web accessibility guidelines says
Do not use tables for layout unless the table makes sense when linearized. Otherwise, if the table does not make sense,
provide an alternative equivalent (which may be a linearized version).
By using the div tag rather than a table we are improving the accessibility and structure of our web site. To see an example of using this structure where we have added a splash of color, some graphics and formatted the text please click this link Click here to open the example.
The Title Attribute
Including the unexpected in your web design is not a good idea. People like to do things at their own pace. If the page suddenly reloads or content switches some users may not be ready. Remember your page will be read by slow readers and people with learning or cognitive difficulties. Not everyone is at the same performance level as you. The title attribute can be used almost anywhere to give users more information about what's going to happen. Lets look at some examples. Move your mouse over the form button below. The value of the title attribute is displayed, in a similar way to a tooltip. The user knows exactly what's going to happen i.e. "When you click submit a new page will be opened in your browser". Lets look at another example. Consider these text links, both of which look identical. Move your mouse over each to see the difference. In the latter example a tooltip is displayed advising your visitor that a new page will be opened. The code is very simple, you just add the title attribute.
<a href="http://www.realfd.com" target="_blank"
title="This link will open in a new window">
This is a text link </a>
Acronyms and Abbreviations
Here is the code
<acronym title="Cascading Style Sheets">CSS</acronym>
And the styling
acronym { border: 1px dashed #8690ab; }
Next Article
Until then............. Mark O'Connor 22nd May, 2006 |
|||||
<articles> | home | graphics | portfolio | hosting | web database | design | identity | registration | contact |
site :| privacy :| accessibility :| © www.eriginl.com 2003 - 2010, all rights reserved. Be Eriginal ! |