CSSMar 2, 2026 ยท Updated Oct 14, 2026 ยท 4 min read

CSS Media Queries & Responsive Breakpoints (2026 Guide)

CSS media queries tested in Chromium 141: why a phone gets desktop styles without the viewport meta tag (980 px layout), how em breakpoints follow a user's larger default font while px ones do not, and what hover, pointer and preference queries report on desktop and phone.

๐Ÿ“ฑ
Try the Media Query Generator
Free, no signup
โ†’
DG
Derek Giordano
Designer & Developer
In this guide
01Media Query Syntax, Including Ranges02The Tag That Makes Breakpoints Work on Phones03Choosing Breakpoints04px or em Breakpoints?05Input and Preference Queries06When to Use Container Queries Instead

Media Query Syntax, Including Ranges

A media query applies a block of CSS only when its conditions are true. The classic form uses min-width and max-width; the newer range syntax reads like math and avoids off-by-one gaps between breakpoints:

@media (min-width: 768px) and (max-width: 1199.98px) { ... }
@media (768px <= width < 1200px) { ... }  /* same range, no gap */

MDN's compatibility data lists range syntax in Chrome 104, Firefox 102 and Safari 16.4, so it is safe for most sites today; keep min-width forms if you still support older Safari.

The Tag That Makes Breakpoints Work on Phones

Without <meta name="viewport" content="width=device-width, initial-scale=1">, mobile browsers lay a page out as if the screen were about 980 pixels wide and then shrink it. We loaded the same page on an emulated 390-pixel phone in Chromium 141: without the tag the layout width was 980 px and (min-width: 640px) matched, so the phone got desktop styles; with the tag the width was 390 px and the query no longer matched. Every responsive page needs that one line in its head.

Choosing Breakpoints

Set breakpoints where your layout starts to break, not at device sizes; devices change every year and sit at every width. Framework defaults are a reasonable starting grid: Tailwind CSS uses 640, 768, 1024, 1280 and 1536 px, and Bootstrap 5.3 uses 576, 768, 992, 1200 and 1400 px, all as minimum widths. Write styles mobile first, with base styles for small screens and min-width queries adding layout as space grows, so small screens download no overrides they do not use. Our breakpoints guide tests this in detail.

px or em Breakpoints?

In a media query, em is based on the browser's default font size, not on your page's root font size. We raised Chromium's default font size from 16 to 32 px in a 1,000-pixel window: (min-width: 640px) still matched, but (min-width: 40em), the same breakpoint at the default size, stopped matching (matches at 16 px, no at 32 px). Em breakpoints therefore move to a narrower layout for people who enlarge their text, which is usually what they need; pixel breakpoints ignore that setting. Browser zoom affects both equally.

Input and Preference Queries

QueryDesktopPhone (touch)Use it for
(hover: hover)matchesnoHover-only reveals and tooltips
(pointer: coarse)nomatchesLarger tap targets
(prefers-reduced-motion: reduce)when set in the OSwhen set in the OSTurning off non-essential animation
(prefers-color-scheme: dark)when set in the OSwhen set in the OSDark theme

Reduced-motion and color-scheme support goes back years (Chrome 74 and 76, Firefox 63 and 67, Safari 10.1 and 12.1 per MDN). Emulating both in Chromium flipped the queries as expected, which is also how to test them: browser developer tools can emulate these preferences without changing your system settings.

When to Use Container Queries Instead

Media queries ask about the viewport; container queries ask about the element's container, so a card can switch layout in a narrow sidebar and a wide main column on the same page. @container works in Chrome 105, Firefox 110 and Safari 16. Use media queries for page-level layout and preferences, and container queries for components; our container queries guide covers the setup and its traps.

Frequently Asked Questions

What is a CSS media query?+
A CSS media query applies styles conditionally based on the user's device, viewport size, or preferences. The most common use is adjusting layouts at different screen widths for responsive design.
What are the standard responsive breakpoints?+
There is no standard. Tailwind CSS uses 640, 768, 1024, 1280 and 1536 px and Bootstrap 5.3 uses 576, 768, 992, 1200 and 1400 px; treat those as a starting grid and add breakpoints where your own layout breaks.
What is mobile-first CSS?+
Mobile-first means writing base styles for small screens and using min-width media queries to add styles for larger screens. This approach ensures the simplest, lightest styles load by default.
What are container queries?+
Container queries let CSS components respond to their parent container's size instead of the viewport size. This makes components truly reusable across different layout contexts.
Should I use px or em for breakpoints?+
Em breakpoints follow the user's default font size: in our Chromium test, raising it from 16 to 32 px made (min-width: 40em) stop matching in a 1,000 px window while (min-width: 640px) still matched. Use em if layouts should adapt to enlarged text; px if they should depend on width alone.
Try it yourself

Use the Media Query Generator โ€” free, no signup required.

โšก Open Media Query Generator
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.
โšก Try the free Touch Target Size Checker โ†’