CSS Academy · Lesson

Syntax and Common Breakpoints

Learn media query syntax and the standard breakpoints used in modern web design.

Lesson 1 of 413 steps

Syntax and Common Breakpoints is a free CSS Academy lesson on CoddyKit. This is 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, and your progress syncs across the web and the CoddyKit app. The CSS Academy course includes 4 lessons in total.

Media Query Syntax

A media query wraps CSS rules and applies them only when a condition is true. The basic syntax:

<div class="box">Media query syntax demo</div>

Media Types

The most common media types:

  • all — applies to all output devices (default)
  • screen — computer and phone screens
  • print — for print preview and printing
  • speech — screen readers
<div class="layout">
    <div class="item">Item 1</div>
    <div class="item">Item 2</div>
    <div class="item">Item 3</div>
  </div>

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.

<div class="box">Breakpoint ladder</div>

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:

<div class="panel">Range syntax demo</div>

Combining with and

Use and to require multiple conditions simultaneously:

<div class="sidebar">Sidebar</div>

Negating with not

Use not to negate a media query. Applies to everything that does NOT match the query:

<div class="doc">Not-screen demo (affects print/speech only)</div>

Multiple Queries with ,

Separate multiple queries with commas — like a selector list. Styles apply if ANY query matches.

<div class="page">
    Multiple queries with comma
    <div class="nav-drawer">Nav drawer (hidden on wide screens or print)</div>
  </div>

Em-Based Breakpoints

Using em units for breakpoints (instead of px) makes them scale with the user's browser font-size preference, improving accessibility.

<div class="box">Em-based breakpoints</div>

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.

Free to start

Learn CSS with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
40
Lessons
159

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. 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. The CSS Academy course includes 4 lessons in total.

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, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.

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

  1. Syntax and Common Breakpoints
  2. Width Height and Orientation Queries
  3. Prefers-Color-Scheme and Prefers-Reduced-Motion
  4. Combining Multiple Media Queries
← Back to CSS Academy