W3C home > Mailing lists > Public > www-style@w3.org > October 2004

assigning classes to IDs

From: Mike Sadka <M.Sadka@nhm.ac.uk>
Date: Sun, 31 Oct 2004 01:31:59 -0700
To: www-style@w3.org
Message-Id: <200410310131.59318.M.Sadka@nhm.ac.uk>

I have a thought which seems obvious to me but which I have never seen
 mentioned, and I wonder if it is part of any CSS specification or

It would be very convenient if one were able to assign a class to an ID
 in a stylesheet.  This would solve the kinds of problem that arise
 when you have a number of common style elements (eg - different
 backgrounds and header styles) which are applied in different
 combinations to a number of different structural elements.

Currently, I have IDs for each structural element and many of the rules
 for one class are duplicated in other classes.  I could create classes
 to apply each style element, and assign them to multiple elements in
 the HTML, but I presume this would be bad semantics as the classes
 would be named after styles which might subsequently change.

If I were able to assign classes to IDs, then this problem would be
 solved.  I imagine one might be able to write something like this in a

..class1 { RULES }
..class2 { RULES }
..class3 { RULES }

#object1 {
#object2 {

That way no common rules would need to be defined more than once,
 whilst retaining accurate structural semantics.


Mike Sadka
Interactive Media Team
Database and Category Manager (Research & Curation)
Extension: 5462
Received on Sunday, 31 October 2004 08:32:47 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:15 UTC