Re: Check existence of class names

Am 12.08.2010 18:39, schrieb Andreas Prilop:
> On Thu, 12 Aug 2010, Vladimir Chukharev wrote:
>> If a tag has an attribute 'class' with a non-existent name
> There is nothing wrong with this!
Exactly. A non existent class name does not exist, as the name already
suggests. So, as soon as a class name is set, this class name exists.

I think this comes from the idea that class names are mainly or only to
be used as handles for styling. Unfortunately the w3c docs suggest this
idea. I think, it should be clearly stated that class names are
primarily for adding semantics and only secondary as style handles. Then
it would be clear that class names may intentionally be given to enhance
semantics without ever wanting to style that in any special way.

Similar for ID's.

So for example let's take just some sentence: "Albert Einstein invented
the atom bomb". In html, you might write this as:

<span class="vcard fn">Albert Einstein</span> invented the atom bomb.

Although there is no need to specially style the words "Albert
Einstein". But using this markup, this adds the semantic to "Albert
Einstein", that this is a name. A name of a person. This is what classes
should be for.

Received on Friday, 13 August 2010 08:12:19 UTC