Standards: February 2009 Archives

Ordered Lists and CSS - Are we losing semantics?

| | Comments (4)

I'm about to question a pearl of standards/accessibility conventional wisdom and ask if we need to rethink how ordered lists are coded in terms of CSS. That is, are we putting too much semantic information in the CSS?

The standard mantra for ordered list OL standards is to use stylesheets to change list numbering types as in the examples below. Another is to make sure that nested lists change numbering schemes between levels to mark a change in list level.

Numeric
list-style-type:upper-latin
Capital Alphabetical
list-style-type:upper-alpha
Lower Roman
list-style-type:lower-roman
  1. Item 1
  2. Item 2
  3. Item 3
  1. Item A
  2. Item B
  3. Item C
  1. Item i
  2. Item ii
  3. Item iii

This is a change from the old days when you would specify numbering schemes and start points with embedded attributes (e.g. <list type="A"> if you wanted capital letters).

From a processing level it makes sense because all ordered lists are numbered lists in disguise. And since modern screen readers appear to recognize the new styles, it appears that a major hurdle is cleared.

On the other hand, this means that all numbering scheme information is in a CSS? That's fine...unless a user chooses to ignore your stylesheet and use a custom style sheet. Then the potential is for a nested listed with distinct numbering levels to become an inaccessible nested list using the same numbering scheme at all levels. Hmmm.

Nested List with CSS Nested List, CSS Disabled
  1. Top Level Item 1
    1. Second Level 1
    2. Second Level 2
      1. Third Level 1
      2. Third Level 2
  2. Top Level Item 2
  3. Top Level Item 3
  1. Top Level Item 1
    1. Second Level 1
    2. Second Level 2
      1. Third Level 1
      2. Third Level 2
  2. Top Level Item 2
  3. Top Level Item 3

I'm not sure how serious a problem this is, but it is a possible gotcha. The line between "presentation" and "semantics" can be a little fuzzy at times. Of course, if I want my Hebrew numbered lists, I have to rely on the new styles.

Postscript (Feb 13)

This issue is being discussed on one of the language tech list, and someone else made the same objection (I'm glad it's not just me).