What is the difference between a class and an ID ?
id
The id attribute is a unique identifier that is used to specify the document. It is used by CSS and JavaScript to perform a certain task for a unique element. In CSS, the id attribute is written using the # symbol followed by id.
class
The class attribute is used to specify one or more class names for an HTML element. The class attribute can be used on any HTML element. The class name can be used by CSS and JavaScript to perform certain tasks for elements with the specified class name. The class name in CSS stylesheet using . symbol.
Difference between id and class attribute: The only difference between them is that id is unique in a page and can only apply to at most one element, while class selector can apply to multiple elements.