Can a tag have two or more classes? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can a tag have two or more classes?

I was wondering if I could add two or more classes to a tag, as in: <p class="underscore" class="bluebg">

8th Feb 2017, 12:13 PM
Wellington Lopes Regis
Wellington Lopes Regis - avatar
2 Answers
+ 3
Tags can have as many classes as you want, but you need to use an unique 'class' attribute: <p class="underscore bluebg validclassname separatedbyspaces">
8th Feb 2017, 12:27 PM
visph
visph - avatar
0
Thank you!
8th Feb 2017, 12:32 PM
Wellington Lopes Regis
Wellington Lopes Regis - avatar