Re: meaning of the class attribute (was Re: <U> Deprecated)

John Whelan <whelan@itp.unibe.ch> wrote:
| Is this actually the case?  My impression was that the class attribute
| was meant to be interpreted by user agents rather than readers, and
| thus could equally well be "underlined", "definitionofperson", "a1",
| "jabberwocky" or whatever.

You are right. The name of a class is not interpretet by the User-Agent, so
you can if it the name you like.

I only wantet to say, that it it 'bad style' to give classes names that show
up their formatting instead of their meaning in the document.

As you can read in the CSS1 specs:

"CSS gives so much power to the CLASS attribute, that in many cases it doesn't
even matter what HTML element the class is set on -- you can make any element
emulate almost any other. Relying on this power is not recommended, since it
removes the level of structure that has a universal meaning (HTML elements)."

IMO leads a class with a name like "underlined" to constructions like

<P>This sentence is <span class=underlined>important</span>.</P>

so you automatically remove the Html structure. Of cause, you might be using
<EM CLASS=underlined>... but especially wysiwYg applications and their users
wont.

Another case:

A.white {
  color: white
}

<A CLASS=white href="http://external.link.cc">

Later you or someone else wants redesign the document, by changing the CSS
file. When he wants to change the look of the external links, especially the
color, he / you would be a bit confused changing class 'white' to color black.

I see myself and wysiwYg application users acting like described above, and so
the pages are going to be less accessible, for users *and* authors.

But at all you are right. Html 'requires' a locical structure, with CSS it's
only a matter of 'style'.

regards.

Received on Monday, 26 July 1999 06:28:10 UTC