Class– A class is a style (like a group of CSS attributes) that can be applied to one or more HTML elements. It is applied to an HTML element via the class attribute and the class name.

.example-class: {background: #000;}

ID– A ID selector is a name assigned to a specific style. It can be associated with one HTML element with the assigned ID. Within CSS, ID selectors are defined with the # character followed by the selector name.

#example-id: {background: #000;}
%d bloggers like this: