+ 1
What is the key difference between ID selector and CLASS selector?
3 Respostas
+ 4
id="myid1 myid2 " is wrong ×××××
class="cls1 cls2 cls2" possible √√√
+ 1
An id should be used once and classes can be used as many time as you need .
0
ID selector can only be used once in an HTML document while CLASS selector can be assigned to more than one elements in an HTML document.
You can assign more than one class to an element but you can only assigned one ID to an element.
ID selector is defined in CSS with the # sign example #ID while CLASS selector is defined in CSS with the period (.) sign example .CLASS
I hope this explains it