|
Posted by Els on 02/26/06 03:50
Luigi Donatello Asero wrote:
>>>>> What is wrong with this?
>>>>> .subsubsection#sverige
>>>>>
>>>>> I get a "class error"
>>>>
>>>> Of course you do.
>>>>
>>>> So, what is it, a class? (.susubsection) an id? (#sverige)?
>>>> Can't make the two into a hybrid.
>>>
>>> "subsubsection" should be the class and "sverige" the id which belongs
>>> to the class "subsubsection" and which I want to define.
>>
>> Then just use #sverige. There is only one element with id 'sverige' on
>> the page (I hope!), so the class need not be mentioned.
>
> I have not checked up, yet whether there is only one "id" or not which is
> called "Sverige" but why should it be an error to specify both the class
> which is the parent and the "id" which is the child?
Because they are names to identify elements. One element with two
names, is not a child of itself. Is Asero a child of Donatello which
is a child of Luigi? No, they all refer to the same person.
If you write <div class="foo" id="bar">, you are giving two names to
one element. This is very much okay, and certainly has its use.
But you can't say that #bar is a child of .foo, because it's one and
the same element they refer to.
--
Els http://locusmeus.com/
Navigation:
[Reply to this message]
|