Article 1

All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.

Article 2

Everyone is entitled to all the rights and freedoms set forth in this Declaration, without distinction of any kind, such as race, colour, sex, language, religion, political or other opinion, national or social origin, property, birth or other status.

Article 6

Everyone has the right to recognition everywhere as a person before the law.

From this we see that human rights respect the dignity of the individual and have no limits or distinctions, and apply to everyone regardless of their status.

Next, let’s look at the three points mentioned in Vlad’s article, the right to choose where we work, the right to access education, and the right to participate in culture.

Article 23.

Everyone has the right to work, to free choice of employment, to just and favourable conditions of work and to protection against unemployment.

Article 26.

Everyone has the right to education. Education shall be free, at least in the elementary and fundamental stages. Elementary education shall be compulsory. Technical and professional education shall be made generally available and higher education shall be equally accessible to all on the basis of merit.

Education shall be directed to the full development of the human personality and to the strengthening of respect for human rights and fundamental freedoms. It shall promote understanding, tolerance and friendship among all nations, racial or religious groups, and shall further the activities of the United Nations for the maintenance of peace.

Article 27.

Everyone has the right freely to participate in the cultural life of the community, to enjoy the arts and to share in scientific advancement and its benefits.

I think that is safe to say that an accessible web is necessary to meet all of these goals in 21st century Britain, and much of the rest of the world. Article 27 elegantly does away with the argument that only commercial sites are required to be accessible.

Now, I suspect I’m starting sound rather militant about web accessibility which may seem at odds with some of the points I made in my post about Web accessibility myths, particularly Content that isn’t 100% accessible shouldn’t be published.I strongly believe that all content on the web should be accessible to all who want to access it, but I’m also a pragmatic sort of person who thinks that one of the strengths of the web, and reasons for its success, is that it is an easy platform to publish to.

I would not want to discourage a single person from publishing online, or requiring extensive knowledge of the arcane discipline of web accessibility before they do, but at the same time it is imperative that those of us who call ourselves web developers or web designers as well as the suppliers of content authoring tools do our utmost to educate others and develop responsibly.

It isn’t just the law, it is far more important than that. It is a moral obligation.

There is a lot of good advice for the discerning web developer to find on the web on how to make a website accessible, unfortunately there is also plenty of bad or outdated advice out there as well. Here are a few of the myths of accessibility that you may hear.

Validation equals accessibility

Good markup is the foundation of a usable, accessible and robust website. Testing that the HTML (and CSS) that you write passes a validation test can be very useful, and in general validity is something to strive for. As my colleague (and true accessibility genius) Benjamin Hawkes-Lewis puts it, valid code is a contract between you and the browser vendors – you write valid code, they will render it correctly (in theory!).

But this is not the same as accessibility, validators do not check that alt attributes are relevant, or that link text is useful. They do not test page interactions to ensure that they are usable by all. They do not ensure that text is readable. All of these issues are more important than validation, and given a choice between accessibility and validation, accessibility should win every time. Sometimes it is necessary to ignore the specification altogether, and write invalid code. Learning when and why is something that requires experience and knowledge, along with much testing when the time come, but don’t let the idea that invalid markup is always bad put you off.

If it works with a screen reader it is accessible

I think the majority of developers and their clients have got passed the idea that visual impaired people do not use the web, however there is so much focus on screen reader users that it is easy to forget that there are other groups of users that we need to make the web accessible for.

Fortunately over the last year I have seen much more information and new tools made available for opening up the web for many more people, from YouTube’s automated captioning of videos to the interest shown at events like Standards.next with a focus on cognitive disabilities. I hope this continues.

Sites are either accessible or inaccessible

Accessibility is very subjective, even by comparing against guidelines such as WCAG 2.0 it isn’t really possible to grade how accessible a website is. Content that is highly accessible to a visually impaired user with a screen reader may be inadequate for a user who lacks fine motor control.

The point is that there is almost always room for improvement, and that it is worthwhile making small changes that improve the user experience for only a small number of people – every little bit helps.

Content that isn’t 100% accessible shouldn’t be published

There is a growing trend of criticising any content that isn’t accessible to everyone, and this is counter-productive. The web has thrived and become what it is today because it is easy to publish to, by almost everyone. We might hope for more accessible content on the web but we must not discourage publishers, for example while there is no doubt that captioning of YouTube videos is a great boon to many people I would not like to see the pressure to caption put anyone off uploading a new video. Authoring tools and automation are the key for helping small publishers and non-developers make their content accessible, and we shouldn’t criticise the author if the available tools are inadequate.

The pressure seems particularly great on developers, who apparently should be held to higher standards. Christian Heilmann mentioned this in conversation recently, talking about how developers avoid putting slide decks of presentations they have online because they are not in an accessible format. This is a situation that benefits no one.

I believe that open content that is inaccessible to 50% of people is better than content that is never published. Ideally it is published with a license that allows others to take it and convert it to different forms which may be accessible, but this isn’t possible if it only exists in a file on someone’s desktop.

In conclusion…

I guess the theme of this post is that accessibility isn’t a target to aim for, it is a goal to aspire to. There is always something that can be more accessible, always another scenario that you have yet to consider, so release that application, publish that article, do your best the first time around and learn from mistakes when things don’t go well.

Alt attributes are used to provide alternate text for non-textural HTML elements, most commonly on img elements. Generally their use is quite straight forward, but it is important that the attribute value you use is appropriate to the situation. In this post I’m going to talk about a few different use cases.

Let’s start the W3C description from the HTML 4.01 specification:

Several non-textual elements (IMG, AREA, APPLET, and INPUT) let authors specify alternate text to serve as content when the element cannot be rendered normally. Specifying alternate text assists users without graphic display terminals, users whose browsers don’t support forms, visually impaired users, those who use speech synthesizers, those who have configured their graphical user agents not to display images, etc.

The alt attribute must be specified for the IMG and AREA elements. It is optional for the INPUT and APPLET elements.

While alternate text may be very helpful, it must be handled with care. Authors should observe the following guidelines:

Do not specify irrelevant alternate text when including images intended to format a page, for instance, alt=”red ball” would be inappropriate for an image that adds a red ball for decorating a heading or paragraph. In such cases, the alternate text should be the empty string (“”). Authors are in any case advised to avoid using images to format pages; style sheets should be used instead.

Do not specify meaningless alternate text (e.g., “dummy text”). Not only will this frustrate users, it will slow down user agents that must convert text to speech or braille output.
play terminals, users whose browsers don’t support forms, visually impaired users, those who use speech synthesizers, those who have configured their graphical user agents not to display images, etc.

So in HTML 4.01 an image always requires an alt attribute, but sometimes the appropriate value may be nothing at all if the image is purely decorative, a delimiter between links which are already in a list for example. Ideally these should be moved to our presentation layer, CSS, but in the real world it is not always possible to avoid having some decorative images in markup.

Some images repeat content which is available in another form. Let me give you an example:

My dog is called Milly. She is a Cavalier King Charles Spaniel, black and brown in colour,
with a white stripe on her chin.
<img src="http://farm4.static.flickr.com/3200/2730900277_54aa8dbeda_m.jpg" width="240" height="180"
alt="Milly has a white stripe on her chin">

In this example I have described Milly and provided an image to draw attention to one of her features, a small white stripe on her chin. Both the text and the image alt attribute make reference to the stripe, but remember that alt attributes are a replacement for images, so all we are doing is repeating what has already been said. There are no circumstances that I can think of where you would deliberately write ‘..with a white stripe on her chin. Milly has a white stripe on her chin.’

Let’s try this again:

My dog is called Milly. She is a Cavalier King Charles Spaniel, black and brown in colour,
with a white stripe on her chin.
<img src="http://farm4.static.flickr.com/3200/2730900277_54aa8dbeda_m.jpg" width="240" height="180"
alt="">

There is no need to have anything other than an empty alt attribute value as the meaning of the image is conveyed in the associated text. Without the text the image doesn’t make it clear what point I am trying to make – it is only a small white stripe after all. With the image sighted users will get additional information that is difficult to convey in words alone. It is advisable to write text which describes important images in this way rather than including the content in alt attributes so that all users benefit from the description and can easily read what you point you are making even if it is not immediately obvious to them from the image.

There is a different rule for images which are the only content of a link. Links must contain textual content, so an image on its own inside a link must have an alt attribute value. In these cases both the image and the alt attribute text should describe the target of the link.

Let’s try this one more time:

My dog is called Milly. She is a Cavalier King Charles Spaniel, black and brown in colour,
with a white stripe on her chin.
<a hef="http://www.flickr.com/photos/ipouncey/2730900277/sizes/l/">
<img src="http://farm4.static.flickr.com/3200/2730900277_54aa8dbeda_m.jpg" width="240" height="180"
alt="Larger image of Milly"></a>

Here the img links to a larger version of the same image and so we write alt attribute text to explain this. The main text still describes the image so all users will understand the purpose of displaying the image, and the content of the image (a picture of Milly) suggests what the link points to. If for some reason the image is not displayed, or the user uses screen reader software, the link will still make sense.

As for the other elements which allow alt attributes you can follow the same rules – treat area elements and input elements of type=image as you would an image which is the only content of a link, and applet elements as a regular img element.

Although these guidelines seem simple, correctly describing content can make a substantial difference to usability and accessibility so it is worth spending a little time to decide on the most appropriate text for alt attributes.

In many articles and blog posts on web accessibility use of the title attribute is promoted. Unfortunately this isn’t the magic bullet that many developers think it is, and I will argue for its use as a last resort.

First let’s see what the HTML 4.01 spec has to say:

This attribute offers advisory information about the element for which it is set.

Values of the title attribute may be rendered by user agents in a variety of ways. For instance, visual browsers frequently display the title as a “tool tip” (a short message that appears when the pointing device pauses over an object). Audio user agents may speak the title information in a similar context. For example, setting the attribute on a link allows user agents (visual and non-visual) to tell users about the nature of the linked resource.

Sounds like it might be quite useful. The specification gives an example of its use:

Here we start to see the problems in the way it is used. Very often a title attribute on an anchor repeats information that is already contained in link text. Supposing that the title text is read by a screen reader what additional information does it provide? Little to none in this example, and unfortunately in most other examples I have seen.

Of course just because it is used badly in an example (and in most places that it is found in the wild) doesn’t prevent it being useful in other cases. What does is the way user agents deal with title attribute values.

As the specification says title attributes are most commonly displayed in user agents (web browsers in most cases) as tooltips, but only on hover with a pointing device and not on keyboard focus. If you are a keyboard only user with a visual user agent then it is very likely that you will not see a single title.

Even if you use a mouse or other pointing device there is a good chance that you will not see title attribute content as there is no visual indication that there is content to find, so unless you are in the habit of hovering over every element on a web page just in case a title attribute is set they will often be missed. Links are the most common place to find title attributes, but even then a user has to hover over a link for a second or two before the tooltip appears thus limiting their discoverability.

…the title attribute is VERY rarely read on links. Screen readers have an setting to read the screen text (the blue underlined text inside the link), the title attribute, or the longer of these two. The default is screen text and I’ve only very rarely seen users change this so that the title attribute is read. So, while it’s OK to use title attribute to provide additional advisory information (that’s what the HTML spec says title is for), do not rely on it for accessibility and don’t count on it ever being seen or read by a screen reader.

So title attributes aren’t very useful then, but does this mean they are harmful? In my opinion they can be because they give the impression to developers that their use can make content more accessible to users and this simply isn’t the case. Often I see title attributes being used to cover up for inadequacies in regular content, for example:

<a href="#" title="Information about XYZ">click here</a>

The issue here is that the link text does not provide sufficient information about the destination when it is not in its full context. The solution is to fix the link text, not to add a title attribute.

User agents will display a tool tip when the mouse hovers above an input element containing a title attribute.

If no label is available, JAWS and Window-Eyes speak the title attribute when the form control receives focus

JAWS 6.0 and later can be set to speak both label and title when the two items are different; however, very few users are aware of this setting.

WindowEyes 5.5 has a hot key, ins-E, that will display additional information, including the title attribute, for the item with focus.

I have one criticism of this advice however, and that is that it doesn’t make it clear that this is a technique of last resort. In a situation where a label cannot be accommodated by the visual design first consider the possibility that the visual design might be flawed rather than immediately use this technique. As with links title attributes on input elements are not displayed on keyboard focus, and only after delay on mouse hover. While for many users the layout may provide sufficient context from which to derive the purpose of an input element add a screen magnifier to the mix for a keyboard only user and we are back to content that is obfuscated. If it is possible to accommodate a label for each input element in a design then do so rather than use a title attribute.

In conclusion, whenever you are thinking of using a title attribute think carefully about whether this is the right approach – more often than not you will find that by changing your content the problem, and the need to use title, goes away. If you can find no other alternative then understand that there is no guarantee that content in a title attribute will be available to your users.

Update

There are a couple of comments that deserve a response.

As Jared points out the key phrase in the HTML specification is ‘advisory information’, however I think it can be difficult to determine what is advisory and what can, for some users, turn an unusable interaction in to a usable one. In my opinion the safest option is to assume that any potentially useful content is useful, and sometimes necessary, to all users and where possible to display it by default. Sometimes a tidy design which otherwise improves the user experience doesn’t allow for advisory information, in which case use of the title attribute is a possibility, but as I say in the post it should perhaps be a last resort. The same can apply to any situation were you want to visually hide content, for example to make it available only to screen readers by positioning it off screen – it is a great technique but be sure to understand the consequences before using it.

Thierry mentioned the problems screen magnifier users can have with title attributes. The focus of this post was how unreliably content in title attribute values is made available to users, but he is right to point this out. The issue is that when a title attribute is displayed as a tooltip it covers, and can obscure, other content. With a screen magnifier a smaller area of the page is visible at a time, the tooltip will cover a larger proportion of the visible area than normal, and can therefore get in the way that much more.

Before I start blogging about some more technical matters I want to write a little about being a Web Developer.

I love it.

For me it is just about the perfect job, exactly the right mix of science and art to keep me interested and focused. Over time I have come to appreciate it in other ways as well, and this is what I really want to write about.

As a bit of a lefty socialist type I like to think that I can make the world a little bit better. When I started Web Development as a professional back in the year 2000 I felt that I had in some ways just become part of a machine. I was working at an agency (although they didn’t call themselves one) and more often than not my work was just a way for people with money to make more money. Such is capitalism.

Over time my skills improved, my knowledge of usability and accessibility increased, and I realised something. My work could dramatically improve people’s lives. And that is pretty damn cool.