Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
>> In the last movie we talked about how important it is to use alt text that conveys the purpose of information than an image is providing. But there are some times when it can actually harm accessibility to add alt text to our images. Note that the section 508 with WCAG guidelines just require a text equivalent, that text equivalent doesn't have to be inside the image itself. The point is to make sure that screen reader users get all of the information sighted users do. So if the information the image conveys is also conveyed in the test else where on the page you met the requirement.
If you were to repeat the equivalent in an alt attribute the screen reader user would have to hear it twice which is unnecessary and would probably be very frustrating. Let's look at an example. If you are following along with the exercise files open residents.html in Dreamweaver, it is located in the 0602 folder of the chapter six exercise files. Scroll down the page to see the entire image, underneath the image is written the caption.
This is simply a regular paragraph element but note that it's providing information about the image. In this case the text equivalent is provided in this paragraph. There is no need for us to repeat it inside the alt attribute image itself. But the screen reader still needs to be told that the image already has a text equivalent else where on the page. This is done by including the alt attribute on the image but leaving it value blank. The screen read has nothing to read so it just skips over the image which is exactly what we want.
Click on the photograph, you'll see on the alt field of the properties inspector that no value is currently set, that doesn't mean that the alt attribute has been set to empty as we want. Where there is no content inside the properties inspector in Dreamweaver it means that the alt attribute is missing from the image tag all together. So click on the arrow in the alt field and choose the option empty. When we choose this option Dreamweaver adds the alt attribute to the image that keeps it value empty.
Let's see this by going into the code view. Click on the code button in the document toolbar, the alt attribute is now in the image tag but there is not content between the quotation marks, this is exactly what we want to happen. Another scenario where you would want screen readers to skip over an image is if the image was purely decorative. In those cases it is really just there for the sake of sighted users and there is no text equivalent that you'd want a screen reader user to hear. So we would again use an empty alt attribute.
Open the page index.html from the same exercise files folder. We're going to add a decorative image to this page. In design view place your cursor at the start of the first paragraph of text, then go to the insert menu and choose image. In the select image source dialog box browse for the location of the exercise files on your computer, go to the chapter six folder and then the 0602 folder and then the images folder and chose the image named carnival.jpeg, click OK.
The image tag accessibility attributes dialog box appears. This dialog box comes up because earlier we set our Dreamweaver preferences to prompt us for accessibility on images, frames, media and forms. If we had the images accessibility preference unchecked we wouldn't see this field. We could still add alt text to all of our images of course but this serves for a good reminder to do so ever time we enter a new image. We want the alt attribute to be blank so click on the arrow in the alternate text menu and choose empty.
Don't worry about the long description field for right now, we will cover that in a later movie, click OK. The image is now added to the page, you can see in the properties inspector page that the alt attribute has been set to empty. Using empty alt attributes is especially important in old table based pages because they frequently us spacer GIFs or other images for formatting purposes. You would give these images empty alt attributes, never spacer images or anything along those lines. Other examples of decorative images would include images used for bullets or dividing lines.
This points to another advantage of CSS layouts, most of the decorative images are kept in the style sheet so there's no needs to worry about setting empty alt attributes on them, but for all of the images you have in HTML of the page an alt attribute should always be present on the tag. The content of that alt attribute will depend on whether that image is content, navigation or decoration and whether the content of the image is conveyed in text elsewhere on the page. If you have many old pages that you need to add alt text to our next movie will go over so ways to speed up that process.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.