Re: ID and CLASS (fwd)

MegaZone <>

>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
>>CLASS. By now I think that ID is only for one occurence in a file and
>>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.

The term 'value' can be somewhat misunderstood here. ID identifies and sets
style to one and only one occurrence of an element while class can be
attached to any number of elements. By singling out one occurrence of an
element  the unique value can be declared to said element. However, ID can
be declared shorthand property which holds a number of values as well as
more than one property each holding one or more values.

#eva1 {background: red; color: white}

<ELEMENT ID=eva1>This and ONLY THIS occurrence of the ELEMENT element can be
identified as eva1</ELEMENT>
<ELEMENT2 ID=eva1>This element CANNOT be identified as eva1</ELEMENT2>

.eva2 {background: red; color: white}

<ELEMENT class=eva2>This and any other element can be classified as
<ELEMENT2 class=eva2>This element can also be classified as eva2</ELEMENT2>

Received on Wednesday, 12 November 1997 05:02:38 UTC