The first standard that we’ll explore in our series on understanding WCAG 2.0 is 1.3.2, Meaningful Sequence. This standard is required for WCAG level A compliance, which is part of the level AA compliance that Section 508 requires. Here’s the complete text:
1.3.2 Meaningful Sequence: When the sequence in which content is presented affects its meaning, a correct reading sequence can be programmatically determined. (Level A)
In other words, if the order of the content on the page is important, you need to tell a screen reader the order somehow.
There’s a lot of ways to give content order. This blog post has order, for example. So far, we have a paragraph (a p
element), a blockquote
, then two more paragraphs. WordPress puts all of those a division (a div
element). So the structure of this blog post is:
div
p
blockquote
p
p
This blog post depends on sequence for the content to make sense – after all, if the paragraphs got switched, it wouldn’t make sense.
Screen readers use the order of tags on a page to automatically determine sequence. So if your page is mostly text and pictures, you probably already meet this requirement.
The problem occurs when there’s content which is visually in sequence, but whose actual representation isn’t in sequence. Imagine this scenario. You want to put two pictures on your page next to each other, with a caption on each one. You’re having trouble making it look right, so you decide to use a table. It’d look something like this:
A picture of a cat in a monitor | A picture of a cat chewing on a monitor |
Poof! It works, right? But tables can be read left to right or top to bottom, and the screen reader has no way to know which it should do. So, like most of us, it defaults to left to right, meaning it reads this:
See the problem now?
Ah, but wait, you say, what about alt
tags? Don’t they label the picture?
Well, they would. But this is a circumstance where you want to have an explicitly empty alt tag – alt=""
. Because these pictures are captioned, an alt
tag is redundant. If they had an alt tag we’d be reading the caption to them twice: once in the tag, and once in the caption. And also, even if we did want an alt tag here, that wouldn’t solve the problem.
Blind people aren’t the only people to use screen readers. Many people simply have really, really poor vision, and may be using a screen reader to help read to them. And while their vision is poor, it doesn’t mean they couldn’t still enjoy these cat pictures. The table above doesn’t let someone with poor vision associate a caption with the appropriate picture.
The solution is to use div
tags, and set them to the left and the right side of the page. One easy way is to set your div
tags to 50% of the width of the page, then set one to float to the left, and the other to float to the right (for the technically minded, you’d may also need to clear afterward). On our Drupal pages, you can use the classes “half left” and “half right” on div
tags. Because we’re then grouping our picture and our caption inside of a div
on each side, everything will be read in order.
Tables aren’t the only concern with sequence. Have a look at this list:
- Head east on H St NWt
- Turn right onto 13th St NW
- Turn left onto Pennsylvania Ave NW
- At the traffic circle, take the 1st exit onto 1st St NW
We recognize those as directions, right? But the bullet points are actually a problem. Those bullet points are considered an unordered list (A UL
tag). Directions have a sequence. If we use bullet points, we haven’t told the screen reader what order to read the bullets in (it’ll probably know, but why risk it?). Instead, we need to use an ordered list (an OL
tag):
- Head east on H St NWt
- Turn right onto 13th St NW
- Turn left onto Pennsylvania Ave NW
- At the traffic circle, take the 1st exit onto 1st St NW
You should also pay attention to div tags that are floated from the text. If you have an introductory paragraph that explains some topic, then a sidebar floating that provides clarifying points, you’ll want to make sure the clarifying sidebar is inserted into the HTML after the introductory paragraph, since understanding it depends on first reading the introduction.
If you’d like to read more about meaningful sequence, you may also be interested in Guideline 57, Ordering the Content in a Meaningful Sequence, which provides an example and a bit more detail. For complex layouts, you may also want to look at aria-flowto, which provides a kind of goto statement for text, to tell the screen reader when to jump over text that is out of sequence for presentation.
Interested in more? Check out the listing of all the posts in this series.