Stacking CSS Classes

By on July 19, 2004

Stop me if you’ve already heard this one, but you can simplify your CSS stylesheets by using multiple CSS classes on a single element. I only learned about this handy feature a year ago, so I’m assuming that some of you may have missed it as well. Allow me to demonstrate by way of example.



  1. Deane informs me that he once sent me this tip in an email, with examples and everything, and I wrote him back and told him that it was a “confusing and useless” feature. Outlook search claims it never happened, but I’ll go ahead and publicly admit my egregious mistake and say that I was 100% wrong about that.

  2. I bet if you look through this site long enough, you’ll find some stacked classes somewhere. I’ve been using this for months now.

  3. Hi. I tried this method on a div, rather than a class. But it doesn’t seem to be working. Does it work for Divs?

Comments are closed. If you have something you really want to say, tweet @gadgetopia.