> Thanks, Tim. Yes, you are quire right about the proliferation of classes,
> and I did not know about applying a second class. This has been the
> result of "learn as I go" and it seemed easier (at the time) to simply
> copy a class and make a few adjustment.
> 

We all learn as we go.  Just some of us have been going longer.  :)  I learned 
that trick on this very list a few years ago. It's come in handy quite a few 
times since.

Not only can you apply multiple classes to elements, you can also select 
elements with both classes and apply styles to only things with both.

For example:
.column {width: 48%}
.left {float: left}
.left.column {
        border-right: 1px solid #333;
        padding-right: 1em;
}

Note the lack of a space in the last selector.

This code will make anything labeled as a column have a 48% width, and anything 
labeled as left float left.  So class="left column" will be 48% and floated 
left.  But that last style will also give left columns a bit of white space and 
a border for a column rule effect.

The possibilities are pretty nifty when you get into it.

---Tim
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to