Your host:
Stephen Chapman
Stephen Chapman

Multiple Classes

Suppose that you have a situation where you have defines=d two classes that you are using on your page. Some of the elements of your page use one class and some use the other. As you are applying the class attributes to the various tags you suddenly come to a tag that requires both classes.

Fortunately this situatuion doesn't cause a problem. We simply add one class attribute and put both class names in it separated by a space like this:


<div class="mystyle1 mystyle2">

With this definition the entries in the stylesheet for both styles will be applied to this section of the page.

What happens if the two classes supply contradictory style information? Well in that case the information from the second one specified in the class attribute will be applied.

go to top

Add to del.icio.us

Loans - Credit Card Consolidation - Internet Marketing - Internet Marketing