If a style refers to only one unique element, an ID-based selector is most appropriate.
If a style can relate to multiple elements, use a class.
Another thing to keep in mind is selectors with an identifier that have a higher priority than class-based ones. This helps if any of your unique ID'd elements inherit styles from more general, classified rules.
source
share