CSS
CSS Media QueriesCSS Media Queries
CSS media queries apply styling rules based on screen size.
Read Time
5 min readDifficulty
BeginnerLast Updated
Jun 15, 2026Version
v1.0.0Introduction
CSS media queries detect the user's screen width and apply specific styles accordingly. Developers use them to stack side-by-side columns on mobile phones or hide complex navigation bars on small screens.
Syntax
Syntax
Example
Example
Key Points
- The `@media` rule wraps the conditional CSS.
- The `max-width` targets screens smaller than the value.
- The `min-width` targets screens larger than the value.
- Media queries drive all modern responsive design.