Posted by Jukka K. Korpela on 03/05/07 13:29
Scripsit Ciaran:
> Hi is it possible to set a class to another class in a stylesheet
> file?
No. Classes don't exist in CSS at all. They exist in markup; CSS just refers
to them.
> As circumstance would have it I need to do something like this:
>
> .class1{ color:#ccc;}
>
> .class2{ class:class1; width:200px;}
No, you don't need to do such things. You should not set color without
setting background, and you should not set widths in pixels excep in special
occasions.
You might find use for things like
..class1, .class2 { color: #ccc; background: white; }
..class2 { width: 15em; }
(with more sensible class names of course).
> It kind of goes agains the whole "cascading" idea
This has absolutely nothing to do with the cascade, which is the most
misunderstood concept in the Whole Wide Web.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
[Back to original message]
|