Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
An ID may only appear once on the page. Only one ID may be used per element. A selector with an ID is higher in the Cascade than a Class in a CSS document, in other words, it has greater specificity by default than a class.
A class, on the other hand, may be used multiple times on a single element, and may appear multiple times throughout the page.
An ID is for unique elements. A class is for generic, reusable elements.
|