0
Diffrerence between id and class
I don't understand the differences of those ,are they the same ? And why?
2 Respostas
+ 11
Id and class attributes can both be used to reference an element, but there's a slight root difference between them:
- id provide an html element identifier, supposedly been unique ( unique id for unique element )
- class provide an css style identifier, can be used on many html element class attribute ( and each class attribute can define many class names separated by a white space to be applied to an html element )
+ 7
id is unique, whereas class can be used for different tags.