Stacking CSS Classes

Jul 19

Stacking CSS Classes

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.

Comments

by Dean in Des Moines,   July 19, 2004 5:08 PM  

Hmmm... Very cool. I can already see changing the code on my site. Darn you, now I won't sleep tonight!


by Joe,   July 19, 2004 5:31 PM  

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.


by Deane,   July 19, 2004 6:05 PM  

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.


by dz,   July 19, 2004 10:16 PM  

I saw this a while back but forgot all about it. This is awesome, thanks for the refresher!


by pablohart,   January 13, 2005 3:50 PM  

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?


by Coolguy,   May 22, 2006 1:31 AM  

So do you always have to use a hyphen to declare step or child classes.



Comments are Closed

Thanks to all who participated.

Want to advertise on this site? Contact FM.