> I have inherited some CSS from a former employee that has code like
> this:
[quoted text clipped - 5 lines]
>
> Is this valid CSS?
See <http://www.w3.org/TR/html4/struct/global.html#adef-class>:
class = cdata-list [CS]
This attribute assigns a class name or set of class names to an
element. Any number of elements may be assigned the same class name or
names. Multiple class names must be separated by white space characters.

Signature
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
> I have inherited some CSS from a former employee that has code like
> this:
>
> onmouseover="this.className='highlight_on standard_border'"
The code is just as foolish as it looks like. This illustrates well why class
names should describe the meaning (semantics) of elements rather than their
casual appearance.
The reason for using JavaScript here is probably the fact that IE does not
support the :hover pseudoelement except for links. But that's not a reason
for using foolish class names. Besides, _is_ this a non-link element? As
usual, the URL etc. etc.
> where it appears to activate two different classes, "highlight_on" and
> "standard_border".
It activates nothing. It assigns two classes to the element.
Most probably, things could have been written better by using a single class,
say "hovered", and setting what you like to set for it. However, it's usually
non-productive to try to fix sloppy code.
> Is this valid CSS?
Technically, it's not CSS. There is no CSS construct in the code snippet. But
class="highlight_on standard_border" would be valid (though foolish) HTML,
and JavaScript lets you assign two classes that way, too.
> If it is, is there a limit to how many classes you can apply?
Hardly.
> Any other comments on this, or things I should know relating to it?
Let it be unless it causes real trouble. Don't imitate it.

Signature
Yucca, http://www.cs.tut.fi/~jkorpela/
Giggle Girl - 30 Jan 2006 17:14 GMT
Thank you Johannes and Yucca for your response.
Very helpfull and informitive.
Ann