...

View Full Version : how do I declare two classes in css



ksanjanadevi
11-26-2008, 08:27 AM
I have two classes in HTML ex; <div class="portlet events"></div>
I want to declare the in css in one line rather than two different classes like this .portlet{}
.events{}

can I put like this ex; .portlet.odd{} ????

If I give these classes like the first ex; in css then these effect for other pages also since they are given individual class. so I want to use both class in one line for one style only!!!!


Any one to help

abduraooft
11-26-2008, 08:32 AM
.portlet , .events{

}

_Aerospace_Eng_
11-26-2008, 09:02 AM
I have two classes in HTML ex; <div class="portlet events"></div>
I want to declare the in css in one line rather than two different classes like this .portlet{}
.events{}

can I put like this ex; .portlet.odd{} ????

If I give these classes like the first ex; in css then these effect for other pages also since they are given individual class. so I want to use both class in one line for one style only!!!!


Any one to help

Yes you can use classname1.classname2 however IE6 support may be a little buggy. I can't remember.

Doctor_Varney
11-26-2008, 09:58 AM
Seperated by:

A comma in the CSS and...
A space in the HTML.

http://i183.photobucket.com/albums/x103/Doctor_Varney/signature.gif



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum