What are the best practices associated with using classes vs. ids?

Classes = Classes different each divisions or segments.
IDs = ID represents the special element, only one id is able to appear in a html file