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 OriginalGriff 325
1 Peter Leow 135
2 Afzaal Ahmad Zeeshan 125
3 Zoltán Zörgő 120
4 DamithSL 100
0 enhzflep 40
1 Richard Deeming 25
2 OriginalGriff 10
3 Anddos 10
4 Kornfeld Eliyahu Peter 10


Advertise | Privacy | Mobile
Web03 | 2.8.150224.1 | Last Updated 15 Mar 2013
Copyright © CodeProject, 1999-2015
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