Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > CSS: Class error

Reply
Thread Tools

CSS: Class error

 
 
Luigi Donatello Asero
Guest
Posts: n/a
 
      02-25-2006
What is wrong with this?
..subsubsection#sverige A { background-color: #99ffcc;
background-image:none;
color: #000000; display: block; text-align:center;}

I get a "class error"



--
Luigi Donatello Asero
https://www.scaiecat-spa-gigi.com/de/uebersetzung.php
今天二零零*年二月二十五日
星期*



 
Reply With Quote
 
 
 
 
Jimmy
Guest
Posts: n/a
 
      02-26-2006
Luigi Donatello Asero wrote:
> What is wrong with this?
> .subsubsection#sverige A { background-color: #99ffcc;
> background-image:none;
> color: #000000; display: block; text-align:center;}
>
> I get a "class error"
>
>
>


weird...

try adding a space:

..subsubsection #sverige A

{
background-color: #99ffcc;
background-image:none;
color: #000000;
display: block;
text-align:center;
}
 
Reply With Quote
 
 
 
 
Els
Guest
Posts: n/a
 
      02-26-2006
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.

--
Els http://locusmeus.com/
 
Reply With Quote
 
Luigi Donatello Asero
Guest
Posts: n/a
 
      02-26-2006

"Els" <(E-Mail Removed)> skrev i meddelandet
news:1xxw5g6a8q2el$(E-Mail Removed)...
> 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.


--
Luigi Donatello Asero
https://www.scaiecat-spa-gigi.com/sv...-i-italien.php
Write in peace for peace
 
Reply With Quote
 
Els
Guest
Posts: n/a
 
      02-26-2006
Luigi Donatello Asero wrote:

> "Els" <(E-Mail Removed)> skrev i meddelandet
> news:1xxw5g6a8q2el$(E-Mail Removed)...
>> 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.

--
Els http://locusmeus.com/
 
Reply With Quote
 
Luigi Donatello Asero
Guest
Posts: n/a
 
      02-26-2006

"Luigi Donatello Asero" <(E-Mail Removed)> skrev i meddelandet
news:wx7Mf.46209$(E-Mail Removed)...
>
> "Els" <(E-Mail Removed)> skrev i meddelandet
> news:1xxw5g6a8q2el$(E-Mail Removed)...
> > 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.



In theory there could have been another id which is called "sverige" as
well but belongs to a different class, so I guess that it is always safer to
write both the class and the id. The id is a child of the class.

--
Luigi Donatello Asero
https://www.scaiecat-spa-gigi.com/sv...-i-italien.php
今天二零零*年二月二十*日
星期日

 
Reply With Quote
 
Els
Guest
Posts: n/a
 
      02-26-2006
Luigi Donatello Asero wrote:

> "Luigi Donatello Asero" <(E-Mail Removed)> skrev i meddelandet
> news:wx7Mf.46209$(E-Mail Removed)...
>>
>> "Els" <(E-Mail Removed)> skrev i meddelandet
>> news:1xxw5g6a8q2el$(E-Mail Removed)...
>>> 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.

>
> In theory there could have been another id which is called "sverige" as


No, in theory[1] there couldn't be. In practice there could be, but it
would be wrong practice.

> well but belongs to a different class, so I guess that it is always safer to
> write both the class and the id. The id is a child of the class.


If the element with the id is a child of the element with the class,
as in <div class="subsubsection"><p id="sverige">, then write it as
..subsubsection #sverige.

_________
[1] theory based on assumption that you try to follow the W3C
recommendations

--
Els http://locusmeus.com/
 
Reply With Quote
 
Luigi Donatello Asero
Guest
Posts: n/a
 
      02-26-2006

"Els" <(E-Mail Removed)> skrev i meddelandet
news:u4ap4gtdc22c$(E-Mail Removed)...
> Luigi Donatello Asero wrote:
>
> > "Els" <(E-Mail Removed)> skrev i meddelandet
> > news:1xxw5g6a8q2el$(E-Mail Removed)...
> >> 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.
>
> --
> Els http://locusmeus.com/



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?

--
Luigi Donatello Asero
https://www.scaiecat-spa-gigi.com/sv...-i-italien.php
今天二零零*年二月二十*日
星期日

 
Reply With Quote
 
Luigi Donatello Asero
Guest
Posts: n/a
 
      02-26-2006

"Els" <(E-Mail Removed)> skrev i meddelandet
news:721fru3nawng.i7mkzpmweoxb$(E-Mail Removed)...
> Luigi Donatello Asero wrote:
>
> > "Luigi Donatello Asero" <(E-Mail Removed)> skrev i meddelandet
> > news:wx7Mf.46209$(E-Mail Removed)...
> >>
> >> "Els" <(E-Mail Removed)> skrev i meddelandet
> >> news:1xxw5g6a8q2el$(E-Mail Removed)...
> >>> 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.

> >
> > In theory there could have been another id which is called "sverige" as

>
> No, in theory[1] there couldn't be. In practice there could be, but it
> would be wrong practice.


Do you mean that W3 recommends to use only one "id" for each page
regardless of whether it belongs to the same class or not?

> > well but belongs to a different class, so I guess that it is always

safer to
> > write both the class and the id. The id is a child of the class.

>
> If the element with the id is a child of the element with the class,
> as in <div class="subsubsection"><p id="sverige">, then write it as
> .subsubsection #sverige.



What does "p" stand here for?
Well,
..subsubsection#sverige was what gave an error, wasn´t it?


--
Luigi Donatello Asero
https://www.scaiecat-spa-gigi.com/sv...-i-italien.php
今天二零零*年二月二十*日
星期日

 
Reply With Quote
 
Els
Guest
Posts: n/a
 
      02-26-2006
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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Class A contains class B, class B points to class A Joseph Turian C++ 5 12-30-2005 03:24 PM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
A parameterized class (i.e. template class / class template) is not a class? christopher diggins C++ 16 05-04-2005 12:26 AM
Generic class literals - e.g,, Class<Map<String, Integer>>.class Purush Java 4 04-13-2005 08:40 PM
instanciate a class in a jar file with class.forname, while my main class is in another jar cyril Java 2 08-25-2004 06:55 AM



Advertisments