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).
Asked
Active
Viewed 95 times
2 Answers
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
-
thanks frnd, Its really help full – Deepesh kumar Gupta Jul 04 '16 at 04:42
-
@deepeshkumar Please accept this answer. It's may be help to others. Thanks – A.K. Jul 04 '16 at 04:44
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