Using multiple classes within selectors

November 5th, 2007

The other day I had to style a menu that looked like this:

While styling the menu, I came across an interesting problem. The Content management system was writing two classes into the same element, and there were times when I needed to use both of these classes for styling.

I had to take two classes like this:

<li class="page-1 current-page"><a href="#">Home</a></li>

And write a multiple class selector like this:

.page-1.current-page { }

Is this allowable? Is it supported? Particularly, how do Internet Explorer 5, 6 and 7 deal with multiple classes.

If interested, read Multiple classes within selectors where I outline how these selectors can be used and the issues involved. The article also includes a step-by-step tutorial on how to style the list shown above.