Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET CSS
how to give two css class to the one element ?
can this possible ??
Posted 14-Mar-13 7:51am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
Yes, that's possible, just seperate all classes with a space in the class attribute:
<p class="first second third"> ... </p>
Read more here:
http://webdesign.about.com/od/css/qt/tipcssmulticlas.htm[^]
 
Hope this helps.
  Permalink  
Comments
Marcus Kramer at 14-Mar-13 14:00pm
   
My 5.
ProgramFOX at 15-Mar-13 12:08pm
   
Thank you!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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
<div class="myclass1 mycalss2">content</div>
2). N number of classes
<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.
  Permalink  

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

  Print Answers RSS
0 Kornfeld Eliyahu Peter 265
1 Sergey Alexandrovich Kryukov 202
2 George Jonsson 185
3 King Fisher 185
4 CPallini 155
0 OriginalGriff 6,223
1 DamithSL 4,724
2 Maciej Los 4,196
3 Kornfeld Eliyahu Peter 3,894
4 Sergey Alexandrovich Kryukov 3,496


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 15 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100