WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Graphics and Captions

for

From: Kynn Bartlett
Date: Jan 20, 2006 6:00PM


On 1/20/06, Derek Featherstone < <EMAIL REMOVED> > wrote:
> It is true that the most popular use for the class attribute happens to
> be for style sheet hooks. However, there is *nothing* that says that is
> all it can be used for.

It's the primary use for it.

> "The class attribute... assigns one or more class names to an element;
> the element may be said to belong to these classes. A class name may be
> shared by several element instances. The class attribute has several
> roles in HTML:
>
> * As a style sheet selector (when an author wishes to assign style
> information to a set of elements).
> * For general purpose processing by user agents."
> Source: <http://www.w3.org/TR/html4/struct/global.html#adef-class>;

There are no other "general purpose processing" functions defined.

> I'm not saying that we should assume that there is any semantic meaning
> behind class names - currently there isn't a lot save for the work being
> done with microformats. There is nothing saying that we can't establish
> some and use the class attribute for things beyond presentational hooks.

Except they're not established, and besides, doing so will simply mix
presentational markup with semantic markup, and we'll be back to the
original problem we had in the first place.

> And doing so might actually be a way to enhance the accessibility of the
> web sites and applications we build.

How? Any potential benefits of trying to convey content semantics via
class is dubious and doomed to failure, when the real solution is to
expand the actual semantic markup.

Sure, you could also use the style attribute for something other than
just presentation, but that's a bad idea for the same reason. Classes
are defined in the spec to be "presentational, PLUS MAYBE something
else."

We so totally don't want to go down that path toward "something else."
Wrong route entirely.

> I do agree that we need a richer set of elements than what is currently
> available to us in HTML, but why wait?

Because recent history teaches us that trying to misuse presentational
and/or semantic markup as each other only leads to headaches.

--Kynn