[html] What's the difference between an id and a class?

id and class are two Global / Standard HTML attribute (The global attributes below can be used on any HTML element.)

class Specifies one or more classnames for an element (refers to a class in a style sheet)

id Specifies a unique id for an element

The id attributes gives an element document-wide unique identifier where the class attribute provides a way of classifying similar elements.

The id attribute value must be unique across the HTML page where class attribute can be reused where ever you want to apply the same properties