# Container Queries: Components That Fit Their Space

A container query changes a component's style by the width of the box it sits in instead of the width of the screen, so one product card can be stacked in a narrow sidebar and side by side in a wide spot on the same page.

![Cheat sheet: Container Queries: Components That Fit Their Space](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/10/c63f56fa688c42808f1d94a24ff486e5.webp)

- Category: CSS
- Level: Freelancer
- Tags: @container, Container name, Container query, Container query units, Container type, CSS, Query container
- Updated: November 1, 2026

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