Click here to Skip to main content
15,943,245 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there,
Can anyone tell me how can I apply multiple style to control..
For instance

I have 2 styles named
CSS
.Color
{
}
  
  and

.Size
{
}

How can a Label Get the properties of both???

Thanks in advance
Posted
Updated 18-Mar-11 0:05am
v2

You can assign multiple classes to any Html Element like this:

<div class="Color Size"></div>
 
Share this answer
 
v2
Comments
Albin Abel 18-Mar-11 6:30am    
My 5
Sandeep Mewara 18-Mar-11 6:45am    
Correct. 5!
raju melveetilpurayil 18-Mar-11 8:22am    
my 5..
In the label class="Color Size" separate the classes with a space

So what if both classes has style for same attributes? Then give priority in one class style elements using the !important keyword
 
Share this answer
 
v2
Comments
Espen Harlinn 18-Mar-11 6:23am    
Nice and clear reply, my 5
Albin Abel 18-Mar-11 6:30am    
Thanks Espen Harlinn
Sandeep Mewara 18-Mar-11 6:45am    
Correct. 5!
Albin Abel 18-Mar-11 6:53am    
Thanks Sandeep Mewara
raju melveetilpurayil 18-Mar-11 8:22am    
good one, my 5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900