Combining classes with CSS

Darryl Friesen Darryl.Friesen at usask.ca
Thu Mar 14 00:17:01 EST 2002


> What's the prevailing temperature on referencing more than one CSS
> class at the same time.
> Is this legal? Ill-advised?
>
> Jimmy Ghaphery
> VCU Libraries


I had been wondering this myself, and your message prompted me to finally
spend the 10 minutes looking through the spec that I'd just been too lazy to
do before.  The excerpt below is from the Web Design Group's page at
http://www.htmlhelp.com/reference/html40/attrs.html

    The CLASS attribute specifies the element to be a member of one
    or more classes.  ...  An element may also belong to multiple
    classes; the CLASS attribute value is a space-separated list of
    class names.

    Note that most current browsers do not support multiple classes.
    Such browsers typically ignore a CLASS attribute that specifies
    multiple classes.

So, yes, it's legal.  And if you understand that Netscape is an abomination
and anything but the most simplistic CSS probably won't work with it, then
go ahead and use it.

- Darryl

 ----------------------------------------------------------------------
  Darryl Friesen, B.Sc., Programmer/Analyst    Darryl.Friesen at usask.ca
  Education & Research Technology Services,     http://gollum.usask.ca/
  Department of Computing Services,
  University of Saskatchewan
 ----------------------------------------------------------------------
  "Go not to the Elves for counsel, for they will say both no and yes"




More information about the Web4lib mailing list