What is the difference?


#1

what is the difference between the attributes id and class?


#2

To start with, id has higher specificity (importance) than class.

An id attribute value can only be used once in the document. It can be written on any element. Likewise, class can be written on any element but unlike id it can apply to any number of elements, or types.

This question came up yesterday, so take a look at that topic…

id vs class


#3

thanks now i understand


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.