-3

I have two different css classes (say class1 and class2). how can I add this two classes to a single html tag (say input box).

Deepesh kumar Gupta
  • 884
  • 2
  • 11
  • 29

2 Answers2

4

Try this Need space between two classes.

<input type="button" class="class1 class2" />

CSS

.class1{
// class1 css
}
.class2{
//class2 css
}
A.K.
  • 2,284
  • 3
  • 26
  • 35
2

Just add a space between each class.

<input type="text" class="class1 class2" />

To style the specific class you would do

class1 {
//do styling for class1
}
class1.class2 {
//do styling for class2
}
Ajackster
  • 1,724
  • 1
  • 12
  • 12