# CSS Nesting

CSS nesting lets you write a rule inside another rule, so a component's parts, its hover state and its media queries live together in one place instead of scattered through the file.

![Cheat sheet: CSS Nesting](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/10/69451b8eaaa74d279f7722b3d5f93b7a.webp)

- Category: CSS
- Level: Journeyman
- Tags: CSS, CSS nesting, Nesting selector, Specificity
- Updated: November 1, 2026

Source: https://www.ask-codey.com/cheat-sheets/css-nesting-cheat-sheet
