Link to home
Start Free TrialLog in
Avatar of PagodNaUtak
PagodNaUtakFlag for Philippines

asked on

Simple referencing a class in css

I have a span like this:

<span class="chkbox deselected">

</span>

is the below code is how you reference the span in CSS?

span.chkbox.deselected{

float:left;

}
ASKER CERTIFIED SOLUTION
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if you want to give them the same style (or a common style), then
span.chkbox, span.deselected
{
}
Avatar of JanEnEm
JanEnEm

Although I believe there is no restriction as to use spaces in a className, in this situation I would avoid using spaces.
Hence leave the spaces out and call the class "checkboxSelected"

The CSS selector would then be
 span.checkboxSelected
{
}
Avatar of PagodNaUtak

ASKER

I want to apply a css to a div having the class checkbox and deselected
did you tried my solution?
@qurvinder: Are you saying you want two class to one div/span?

Or do you want a class "selected'  and a class "deselected"?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Communications was too async. I agree with the comments Qurvinder made.
His CSS suggestions are OK!