# Hooks for CSS: the class and id Attributes

The class attribute gives a label that many elements can share and the id attribute names one element, and together they are the hooks CSS uses to style exactly the parts you mean.

![Cheat sheet: Hooks for CSS: the class and id Attributes](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/10/9562d1c4eebc47d39b42a738eb8d4f51.webp)

- Category: CSS
- Level: Novice
- Tags: Attribute (html), class attribute (html), CSS, html, id
- Updated: November 1, 2026

Source: https://www.ask-codey.com/cheat-sheets/css-html-class-and-id-cheat-sheet
