Wednesday, July 18, 2007

An alternative look at alt tags

Alt tags are perhaps one of the simplest elements of a web page to understand – and perhaps one of the most misused as well.

In simple terms, an alt tag is used with any image on a web page as “alternative text”. They were originally set up for people who switched off their “display images” facility in their browser to download the page more quickly. The alt tag meant that you could see what you were missing.

But things have moved on. With the advent of broadband and fast corporate networks nobody switches off their images nowadays. But that doesn't mean that alt tags are not important - modern browsers have made sure of that.

If you don't believe me call up any web page – news.bbc.co.uk is a good example - and move your mouse over an image. You'll see that a small pop-up appears with what looks like a caption. This is the alt tag.

Now, I know what you are thinking – great; we don't need to caption our images any more. We just need to put the caption in the alt tag.

Well, from a usability point of view that would be a disaster. The problem is that you have to mouse over the image to read the alt tag. If you don't you will never know it is there. So I suggest you keep the captions too.

I can hear someone else now suggesting that you could use the alt tag to give more information about the photograph. Not a bad idea – give a basic caption and then put more information, perhaps just putting the copyright details in the alt tag.

While that sounds like a good idea you probably just fell foul of the Disability Discrimination Act, which is where alt tags come into their own. Imagine you are sight-impaired and can't see the image. A screen reading program will “read” the page for you and a speech synthesiser will “speak” to tell you what it says. When it comes to the images all it can do is read the alt tag.

A CiB awards judge will probably not be impressed by an online publication that has no alt tags. It will lose you marks - you have been warned!

So, as a first step, having your caption embedded in the alt tag is very important. This can be accomplished in a number of ways. If you use a content management system (CMS) that asks you to input a caption it can be programmed to copy the text into the alt tag – this is what I do with the CiB website. It is quick, easy and seamless, but not really optimum, as I will show later.

If you have a CMS that converts MS Word documents to HTML you can usually “double click” on the image in Word, go to “web” and add the alt tag.

If you are doing it all by hand then most HTML editing programs have the ability to add alt tags. Beware though as some versions of MS FrontPage set the alt tag as the image filename by default– that's as good as useless!

There is no need to preface the alt tag with "Image:" as the reader will already know that it is an image.

But if you have got this far, can tick all the boxes mentioned above and are feeling smug I'm afraid I'm about to shake you up.

The Royal National Institute of the Blind (RNIB) says: "All images need alt text that is clear and conveys the equivalent information as the image."

That is, if you had to describe your image to a sight-impaired person does the caption actually do the job? I would argue that in many cases it doesn't.

Sometimes, the caption we use supports the image, but does not describe it. In this case our alt tag should be different to the caption. For example, on the BBC News website was an image with the caption "Expectations have been building ahead of the talks" but the alt tag is "Japanese chief negotiator Kenichiro Sasae, Beijing 8/2/07".

If the image is contextual we must fully describe the context. For example "Man reading an insurance policy and looking confused" is better than "Man reading insurance policy".

If the caption describes the image properly, including the names of everyone in the image, you could argue that there is no need to name them in the alt tag. However, from an accessibility point of view I believe that it is better to duplicate the information, as the caption is actually divorced from the image. We only know it is a caption as we can see that it is physically underneath the image - a screen reader may not be so accommodating!

In a nutshell, your alt tag should always describe what you physically see as a bare minimum. If in doubt, more rather than less information is better.

Images of text should have alt text that is the same as the text on the image. If it is a logo with a strapline line then "Motorola logo – Hello Moto" is better than just "Motorola logo".

If you have a system that will only let you input the caption as the alt tag then there is little you can do about it. But if you do have the ability to put a more descriptive alt tag you will be helping sight-impaired visitors a lot.

For more information see www.rnib.org

Handling MS Word 2007 files

As the French Resistance lady used to say in “Allo Allo”: “Leesen very carefully, I vill say zis only vonce.”

If you have to handle copy submitted by other people the information in this feature could save you a lot of grief. And if you don't think it applies to you, just wait!

This month's column looks at the recent changes to Microsoft Word; in particular to the format now used to save documents. From now on Word documents saved in Word 2007 and later have a “docx” extension. If you haven't yet had to deal with one of these you soon will as Word 2007 starts to find itself on desktop machines around the world.

So why is this a problem? Simple - earlier versions of MS Word can't open them!

Docx is a new format that saves your word-processed material in what is known as an XML (Extensible Mark-up Language) format. As Microsoft says: “This enables improved integration with external data sources and systems.”

This is all well and good, but for the time being Docx could prove to be a major headache for anyone receiving Word documents for editing.

If you receive such a file the .Docx extension is the first giveaway. The second is that clicking on it will result in your machine failing to find a program that can open it. At this stage you have a number of choices.

The first is to buy a copy of Word 2007 or Office 2007, although I would hold fire at the moment – there are cheaper alternatives.

The second is to go back to the originating author and get them to save the file in an earlier “.doc” format that you can handle. As a short-term solution this isn't a bad idea, but this pre-supposes that the original author can a) be found and b) be bothered.

The third solution involves getting your hands dirty, and if you can't handle this find someone to help you who can.

If you are using a Windows PC and have an earlier version of Word visit the Microsoft website at www.microsoft.com and search for the “ Microsoft Office Compatibility Pack”.

This is a hefty 26Mb download, but should allow you to open Microsoft Office Word 2007 .docx or .docm files with Microsoft Office Word 2003, Word 2002, or Word 2000.

As Microsoft says: “By using the Compatibility Pack for the 2007 Office system, you can open, edit some items, and save Office Word 2007 documents in previous versions of Word.” Take note of the word “some”. My own tests showed that my copy of Word 2000 would indeed now open docx Word documents, but it lost all the formatting, tables and designated fonts. Not a huge problem if you are only dealing with raw text, but do beware.

If you are a Mac user you could also buy a copy of Word 2007, or you could be a bit canny. I have it on good authority that the next versions of the free NeoOffice and OpenOffice packages for both Mac and PC will support docx too.

After a bit of playing around I discovered that docx is actually a zip archive – remember those? If you change the file extension from docx to .zip you can now “unzip” the file into its component parts.

You'll find that there are now a whole host of separate files that go to make up the original docx document. Navigate to the unzipped “word” folder and you will find a document called “document.xml”.

If you use Safari to open this file you will be presented with the original text. You can now copy and paste this into your older copy of Word. Unfortunately, you will have lost all the carriage returns, but hey, it’s free!

Technically, you can open this XML file in a PC browser too, but chances are that you will see all the tags that make up the file too – Safari strips these out for you.

Alternatively, search on Google for “Docx Convertor” and you will find a Mac Widget that you can install. This is a free drag-and-drop utility that is linked to a website at http://docx-converter.com. It didn't work for me, but could be worth a try.

I am sure that there will be other solutions popping up over the coming months, but these should get you going. As I said at the beginning, sooner or later this will become a problem, so file this feature away carefully – “eet will be published only vonce”.