Unlike the id
selector, the class
selector is most often used on several elements.
This allows you to set a particular style for many HTML elements with the same class.
The class
selector uses the HTML class attribute, and is defined with a "."
A simple way to look at it is that an id is unique to only one element. class
is better to use as it will help you to execute what ever you want.