W3C home > Mailing lists > Public > www-style@w3.org > November 1997

ID and CLASS (fwd)

From: MegaZone <megazone@livingston.com>
Date: Wed, 12 Nov 1997 00:44:50 -0800 (PST)
Message-Id: <199711120844.AAA08903@eve.livingston.com>
To: www-style@w3.org
Once upon a time Volker Kroll shaped the electrons to say...
>its possibly up to me that I don't understand the difference between ID and
>CLASS. By now I think that ID is only for one occurence in a file and CLASS
>for more occurences. Is this correct, or do I misunderstand the spec.

ID - holds ONE and only one value.  And that value must be unique in the

CLASS - can hold a LIST of values, and these values can be repeated on 
other elements.

>BTW, if I specify ID more than one time in a HTML file with linked CSS it
>works as expected, every element gets the desired style, but my validator
>tells me:
>ID is already definded.

The browser is just being nice.  It is not a valid use.  And ID is actually
used more for other things, not style sheets.  Such as defining the
destination to a link, or naming an element to be manipulated by scripting.

Neither use is very tolerant to duplicate ID elements.  

Livingston Enterprises - Chair, Department of Interstitial Affairs
Phone: 800-458-9966 510-737-2100 FAX: 510-737-2110 megazone@livingston.com
For support requests: support@livingston.com  <http://www.livingston.com/> 
Snail mail: 4464 Willow Road, Pleasanton, CA 94588
Received on Wednesday, 12 November 1997 03:52:26 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:45 UTC