Issue
Can I apply 2 classes to a single div
or span
or any HTML element? For example:
<a class="c1" class="c2">aa</a>
I tried and in my case c2
does not get applied. How can I apply both classes at once?
Solution
(1) Use multiple classes inside the class attribute, separated by whitespace (ref):
<a class="c1 c2">aa</a>
(2) To target elements that contain all of the specified classes, use this CSS selector (no space) (ref):
.c1.c2 {
}
Answered By - Salman A
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.