In CSS, an ID selector (e.g., #header) is used to target a single, unique element on a page. Class selectors are used for groups of elements, and element selectors (tags) are used for all elements of a specific type. IDs have higher specificity than classes.