Syntax and Common Breakpoints
Learn media query syntax and the standard breakpoints used in modern web design.
Media Query Syntax
A media query wraps CSS rules and applies them only when a condition is true. The basic syntax:
@media media-type and (media-feature) {
/* CSS rules here */
}Media Types
The most common media types:
all— applies to all output devices (default)screen— computer and phone screensprint— for print preview and printingspeech— screen readers
@media screen and (min-width: 768px) {
.layout { display: grid; }
}All lessons in this course
- Syntax and Common Breakpoints
- Width Height and Orientation Queries
- Prefers-Color-Scheme and Prefers-Reduced-Motion
- Combining Multiple Media Queries