![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there anything wrong with having several classes with the same name in the same style sheet? div.pagedown { img.pagedown { a.pagedown { |
#3
| |||
| |||
|
|
williamc wrote: Is there anything wrong with having several classes with the same name in the same style sheet? div.pagedown { img.pagedown { a.pagedown { You can't have multiple classes with the same name. You _can_ have multiple styles with selectors that match the same class (which is what you have above). -- David Dorward http://dorward.me.uk/ |
#4
| |||
| |||
|
|
williamc wrote: Is there anything wrong with having several classes with the same name in the same style sheet? div.pagedown { img.pagedown { a.pagedown { You can't have multiple classes with the same name. You _can_ have multiple styles with selectors that match the same class (which is what you have above). |
#5
| |||
| |||
|
|
Erik Funkenbusch wrote: .classname {}; is a selector on the root element, is it not? No. It is a selector for *any* element whose class is .classname |
#6
| |||
| |||
|
|
I don't follow. if img.myclass isn't a class, what is? Is it a theoretical construct? Is it the identity assigned to a selector? |
|
So how are img.classname and td.classname not the same class then? |
|
So if those are the same class then the following would mean that the td position style would supercede the img classname, right? img.classname {position:absolute;} td.classname {position:static;} |
#7
| |||
| |||
|
|
If this is still confusing, I suggest you throw away classes for the time being and concentrate on using CSS by selecting elements in other ways. |
#8
| |||
| |||
|
|
On Sat, 20 Sep 2003 19:11:59 +0100, Jim Dabell wrote: If this is still confusing, I suggest you throw away classes for the time being and concentrate on using CSS by selecting elements in other ways. I understand how it works, I just didn't understand the semantics. You've cleared up a few things for me here by pointing out the relationship between HTML and CSS and these terms. Thanks. |
#9
| |||
| |||
|
|
Erik Funkenbusch wrote: On Sat, 20 Sep 2003 19:11:59 +0100, Jim Dabell wrote: If this is still confusing, I suggest you throw away classes for the time being and concentrate on using CSS by selecting elements in other ways. I understand how it works, I just didn't understand the semantics. You've cleared up a few things for me here by pointing out the relationship between HTML and CSS and these terms. Thanks. Erik, You mentioned C programming - did you do any object oriented programming? If so, I think this may be the source of some of your confusion - a lot of programmers expect classes in HTML/CSS to be similar to the use of the term classes in other programming languages and that can cause a lot of confusion - as they are really very different beasts. |

|
If this is at all your case just ignore anything you have ever heard about classes from OOP languages when dealing with CSS classes and it will save you a lot of headaches. |

#10
| |||
| |||
|
|
On Mon, 22 Sep 2003 23:24:13 -0400, Nikolaos Giannopoulos wrote: [snip] If this is at all your case just ignore anything you have ever heard about classes from OOP languages when dealing with CSS classes and it will save you a lot of headaches. Actually, it's not as different as you might think. It just takes a little bending of your understanding to see it ![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |