Syntax and Common Breakpoints
Learn media query syntax and the standard breakpoints used in modern web design.
Syntax and Common Breakpoints is a free CSS Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the CSS Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
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; }
}Media Features
Media features describe characteristics of the device or viewport. Common features: width, height, orientation, resolution, prefers-color-scheme, hover.
min-width Queries
The most used feature — targets screens at or above a width threshold. Mobile-first approach.
@media (min-width: 600px) { /* small tablet */ }
@media (min-width: 768px) { /* tablet */ }
@media (min-width: 1024px) { /* desktop */ }
@media (min-width: 1440px) { /* wide desktop */ }Common Breakpoints
There are no universally correct breakpoints. A popular set based on common device widths:
- 480px — large phones
- 768px — tablets
- 1024px — small desktops, landscape tablets
- 1280px — standard desktops
- 1536px — large desktops
Content-Based Breakpoints
Rather than device breakpoints, modern practice sets breakpoints where the content breaks. Design at one size, resize, and add a breakpoint when the layout starts to look bad.
Range Syntax (Modern)
Modern CSS supports range syntax inside media queries — more readable than combining min and max:
@media (768px <= width <= 1023px) {
/* tablet only */
}
@media (width >= 1024px) {
/* desktop */
}Combining with and
Use and to require multiple conditions simultaneously:
@media screen and (min-width: 768px) and (orientation: landscape) {
.sidebar { display: block; }
}Negating with not
Use not to negate a media query. Applies to everything that does NOT match the query:
@media not screen {
/* applies to print and speech but not screens */
}Multiple Queries with ,
Separate multiple queries with commas — like a selector list. Styles apply if ANY query matches.
@media (min-width: 768px), print {
.nav-drawer { display: none; }
}Em-Based Breakpoints
Using em units for breakpoints (instead of px) makes them scale with the user's browser font-size preference, improving accessibility.
@media (min-width: 48em) {
/* 768px at 16px base */
}
@media (min-width: 64em) {
/* 1024px at 16px base */
}Quick Check
Which media query matches screens that are at least 1024px wide?
Recap
Media queries apply CSS conditionally based on device or viewport characteristics. Use min-width for mobile-first, max-width for desktop-first. Set breakpoints where content needs it, not at arbitrary device sizes. Modern range syntax improves readability.
Frequently asked questions
Is the “Syntax and Common Breakpoints” lesson free?
Yes — the full text of “Syntax and Common Breakpoints” is free to read here on the web, and the CSS Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the CSS Academy course, upgrade to CoddyKit PRO.
What will I learn in “Syntax and Common Breakpoints”?
Learn media query syntax and the standard breakpoints used in modern web design. You practise CSS Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start CSS Academy?
No prior experience is required. CSS Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Syntax and Common Breakpoints” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this CSS Academy lesson?
Yes. Every CSS Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
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