Click here to Skip to main content
16,004,647 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to give two css class to the one element ?
can this possible ??
Posted

Hi,

Yes, that's possible, just seperate all classes with a space in the class attribute:
HTML
<p class="first second third"> ... </p>

Read more here:
http://webdesign.about.com/od/css/qt/tipcssmulticlas.htm[^]

Hope this helps.
 
Share this answer
 
Comments
fjdiewornncalwe 14-Mar-13 14:00pm    
My 5.
Thomas Daniels 15-Mar-13 12:08pm    
Thank you!
You can have more than one class for controls by separating them with space inside class attribute. But you cann't have more than one class attribute to any controls..

Ex: 1). Two classes
HTML
<div class="myclass1 mycalss2">content</div>

2). N number of classes
HTML
<div class="myclass1 myclass2 myclass3 ... ">content</div>


Note: If you written repeating style in both the classes they may get overwrite by each other.. So avoid repeating same styles.
 
Share this answer
 

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