+ 1
Can there be several classes with one tag in html?
3 Answers
+ 2
okay, thanks alot!
+ 2
A tag can have multiple classes but only one 'class' attribute.
(this is true for any attribute)
So you can have <a class='class1 class2'>text</a> and rules for both class1 and class2 will apply. Class names are separated by spaces.
But <a class='class1' class='class2'>text</a> is incorrect. Only one attribute will be recognized.
+ 1
I mean <p class="italic" class="size">content </p>