Support0

CSS @media playground

Build viewport, preference, input, output, print or environment queries, observe their effect in the relevant context, and copy the recipe to try it outside the lab.

Ask AI

CSS @media playground

Response generated with openai/gpt-5.4-nano. AI can make mistakes. Always review the result.

Context: embedded document · current environment. The Baseline card describes range syntax; it does not detect this browser.

@media (width >= 600px)
Requested size
640 × 360 CSS px
Effective viewport
Awaiting observation
Condition match
Awaiting observation
Observed layout
Awaiting observation
Independent support tests

In the same document, known positive and negative tests compare matchMedia() with a hidden CSS marker. Verified covers those cases, not the entire grammar or other hardware. A failed check remains not verifiable; a false query does not establish missing support.

Awaiting observation

width / height
Awaiting observation
(width) / (height)
Awaiting observation
< / <= / = / >= / >
Awaiting observation
a < width <= b
Awaiting observation
em / rem / calc()
Awaiting observation
aspect-ratio
Awaiting observation
orientation
Awaiting observation
resolution · dpi / dpcm / dppx / x
Awaiting observation
resolution: infinite
Awaiting observation
and / or / not
Awaiting observation
all / only / not
Awaiting observation
a, b
Awaiting observation
@media { @media { … } }
Awaiting observation

The example keeps its actual size in CSS px. Focus the viewer and use the arrow keys to explore it when it does not fit. The color identifies the query and highlights the example when it applies.

HTML
<article class="card">
  <section>
    <h2>A viewport of its own</h2>
    <p>This card lives in an independent document. Queries are evaluated in that context, with its actual dimensions and capabilities.</p>
  </section>
  <section>
    <h2>Content changes layout</h2>
    <p>When every nested rule matches, two columns appear. Otherwise, the sections stack in one column.</p>
  </section>
</article>
Tailwind CSS
Examples for Tailwind CSS 4.3 with the default theme. Custom values keep arbitrary classes when there is no equivalent utility. Changing the theme can change utility values.
<article class="grid grid-cols-1 gap-4 font-sans text-base/6 wrap-anywhere min-[600px]:grid-cols-2">
  <section>
    <h2>A viewport of its own</h2>
    <p>This card lives in an independent document. Queries are evaluated in that context, with its actual dimensions and capabilities.</p>
  </section>
  <section>
    <h2>Content changes layout</h2>
    <p>When every nested rule matches, two columns appear. Otherwise, the sections stack in one column.</p>
  </section>
</article>
CSS
.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  font: 1rem / 1.5 system-ui;
  overflow-wrap: anywhere;
}

@media (width >= 600px) {
  .card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

CSS query guide

@media: query the context, apply CSS

From viewport to cascade: build conditions, interpret results and decide whether an adaptation belongs to the page or the component.

Mental model

The browser evaluates a condition; the cascade decides which declarations actually apply.

  1. Queried context

    The viewport or an environmental capability of the document.

  2. Evaluated condition

    A query may match, not match, or contain unknown terms.

  3. Styled subject

    Selectors inside @media choose the elements receiving declarations.

From context to elementStatic diagram: context → condition → subject. No named container ancestor is required to query the viewport.

@media makes rules conditional; it does not change the viewport or queried capability. A false query can be fully supported. A true query does not guarantee that its declaration wins against other rules.

Viewport and dimensions

The document window is the reference for width, height, aspect-ratio and orientation.

In Viewport mode, the scene lives in an iframe with its own viewport. Changing a div in the host does not change that document’s queries. Dimensions use CSS px, not physical pixels; zoom can change their relationship. orientation compares width and height: a square viewport is portrait, not landscape. It does not detect a sensor or device type. If an on-screen keyboard changes the queried viewport dimensions, orientation may change without rotating the device.

A card in its own document

Native example independent of the playground. Its iframe fills the available width; resize the window to cross 600 CSS px when space permits.

Below 600 CSS px the sections stack; from 600 they form two columns. The change depends on the iframe viewport, not the card width.
A card in its own document
<article class="card">
  <section>
    <h2>First section</h2>
    <p>Content starts in one column.</p>
  </section>
  <section>
    <h2>Second section</h2>
    <p>The viewport decides when two columns fit.</p>
  </section>
</article>
.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  font: 1rem / 1.5 system-ui;
  overflow-wrap: anywhere;
}

@media (width >= 600px) {
  .card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

Syntax and ranges

Separate media types, discrete values and range features.

A rule may omit its type or use all, screen or print. screen includes screens of any size; it does not mean mobile. only requires an explicit type and historically protects against older agents; it adds no specificity. Comparators <, <=, =, >= and > and min-/max- prefixes belong to range features. A discrete feature such as orientation uses a keyword; min-orientation is invalid.

An interval with different boundaries

An interval with different boundaries
CSS
.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (30em <= width < 50em) {
  .card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

(width) checks its value in a boolean context; it does not ask whether support exists. min-width includes the boundary, just like >=; max-width means <=. In contrast, > and < exclude it. A reversed range can be syntactically valid yet never match. With fractional widths, max-width: 599px and min-width: 600px leave a gap: use < 600px and >= 600px for an exact partition.

Lengths, ratios and resolution

Units change the queried quantity, not the hardware.

width and height are physical viewport dimensions even with a different writing-mode. In a media query, em and rem use the browser’s initial font size or user preferences, not a font-size declared on html or the card. Choose breakpoints when content needs a change, rather than by device names. var() cannot replace a threshold in an ordinary media feature; a custom property resolves in declarations, not in that condition.

Thresholds for different quantities

Thresholds for different quantities
CSS
.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (width >= calc(30em + 100px)) and (aspect-ratio >= 16/9) and (resolution >= 2dppx) {
  .card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

aspect-ratio compares width/height and accepts ratios such as 16/9. resolution queries density: 1dppx = 1x = 96dpi; dpcm uses centimeters. infinite represents unlimited resolution on a vector medium. Changing a threshold changes neither DPR nor resolution. calc() requires compatible dimensions; the builder limits calculations to two length terms or two resolution terms.

Composition and recovery

and, or, not, commas and nesting cannot be swapped without checking the grammar.

and requires every condition; or allows any. Use parentheses when mixing and and or. A comma list accepts any alternative and recovers at the next top-level comma if a branch is invalid. not before a type negates that entire query; not before a condition is grouped as a condition. Multiple nested @media rules must all match.

An unknown alternative and a known one

An unknown alternative and a known one
CSS
.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (baselinelab-unknown-feature), (width >= 600px) {
  .card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

An unknown feature has the logical value unknown: it becomes false when a boolean result is needed, but not unknown remains unknown. A known true branch can make an or or list match. Do not confuse this with an unknown media type, which has its own negation rules. The diagnostic preset uses a fictional feature to explore this distinction without verifying support.

Composition mode mixes active families in the same guided tree: types, negation, and/or, lists and up to three nested rules. The scene queries the iframe viewport and environment, rather than the host page; scripting may be none because of the sandbox. The limit remains twelve leaves and each feature value keeps independent support tests. A false combination does not establish missing support.

Open the CSS query recipes

Composition

Composition
<article class="card">
  <section>
    <h2>First section</h2>
    <p>Content starts in one column.</p>
  </section>
  <section>
    <h2>Second section</h2>
    <p>The viewport decides when two columns fit.</p>
  </section>
</article>
.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  font: 1rem / 1.5 system-ui;
  overflow-wrap: anywhere;
}

@media ((width >= 600px) and (prefers-color-scheme: light)) {
  .card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

Cascade and progressive enhancement

A condition selects candidate rules; it does not strengthen their selectors.

@media adds no specificity. Origin, importance, layers, specificity and order still matter. In this example both rules have the same selector, so the later one wins when both match. Keep a useful base layout outside the query. If a syntax is not understood, that enhancement may not apply; do not resolve a conflict by adding !important.

The later rule also participates

The later rule also participates
CSS
.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (width >= 600px) {
  .card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  grid-template-columns: minmax(0, 1fr);
}

Conditional nesting inside .card keeps the same subject as the flat rule here. Nesting selectors is a different operation and may affect specificity. Neither CSS.supports() for a declaration nor the presence of CSSMediaRule verifies a condition or its effect: observe a known case and the subject’s computed property.

Viewport versus component

Choose the reference that explains the layout change.

Use @media when the decision depends on the page viewport or environment. The same card in a sidebar and the main content may need different layouts within one viewport. That decision belongs to @container and an eligible ancestor.

Two references for the same selector

Two references for the same selector
CSS
.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (width >= 600px) {
  .card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.region {
  container-type: inline-size;
}

@container (width >= 600px) {
  .card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

With @media, all cards in one document share the queried dimensions even when their parents differ in size. A size @container query inspects an ancestor and styles its descendant; component space can change without resizing the window.

Preferences and accessibility

Environment preference, used scheme and simulation are different facts.

Preferences mode queries the host page. Controls choose a condition without changing the system. Simulation starts off and reports its own result. Sharing a URL preserves configuration, not matches in another environment. Each example’s badge describes that family rather than every @media query.

prefers-color-scheme accepts light and dark. light can also represent no explicit preference. It does not read the site’s chosen theme: color-scheme declares supported schemes, while light-dark() picks colors according to an element’s used scheme. A site override can differ from the queried preference.

Light or dark scheme

Light or dark scheme
<div class="preference-example">The condition adapts the style of this content.</div>
.preference-example {
  padding: 1rem;
  border: 2px solid currentColor;
}

@media (prefers-color-scheme: dark) {
  .preference-example {
    background: #202124;
    color: #fff;
  }
}
Explore color-scheme and light-dark()

prefers-reduced-motion distinguishes no-preference and reduce. The sample starts still and is enabled with a checkbox; it animates only under no-preference. The opt-in state is not shared. Reducing motion should preserve an understandable alternative, beyond merely speeding up an animation. The actual environment remains authoritative over simulation.

Motion by user choice

Motion by user choice
<div class="preference-example">The condition adapts the style of this content.</div>
<div>
  <input type="checkbox" class="motion-toggle" id="motion-toggle">
  <label for="motion-toggle">Enable sample motion</label>
  <div class="motion-sample">Motion sample</div>
</div>
.preference-example {
  padding: 1rem;
  border: 2px solid currentColor;
}

@media (prefers-reduced-motion: reduce) {
  .preference-example {
    outline: 3px solid currentColor;
    outline-offset: 3px;
  }
}

.motion-sample {
  padding: 1rem;
  border: 2px solid currentColor;
}

@media (prefers-reduced-motion: no-preference) {
  .motion-toggle:checked ~ .motion-sample {
    animation: media-preference-motion 2s ease-in-out infinite alternate;
  }
}

@keyframes media-preference-motion {
  to {
    transform: translateX(1rem);
  }
}

prefers-contrast accepts no-preference, more, less and custom. more and less are different requests; custom can accompany a forced palette. The recipe reinforces borders for more. Detecting a preference neither measures WCAG contrast nor permits removing borders or focus in other states.

Requested contrast

Requested contrast
<div class="preference-example">The condition adapts the style of this content.</div>
.preference-example {
  padding: 1rem;
  border: 2px solid currentColor;
}

@media (prefers-contrast: more) {
  .preference-example {
    border-width: 4px;
    text-decoration: underline;
  }
}

forced-colors distinguishes none and active. In active mode the browser can replace author colors and remove shadows; a rule may apply even when its final RGB differs. Use system colors and visible borders. Reserve forced-color-adjust: none for essential color information and check content and focus against the actual palette.

Forced palette

Forced palette
<div class="preference-example">The condition adapts the style of this content.</div>
.preference-example {
  padding: 1rem;
  border: 2px solid currentColor;
}

@media (forced-colors: active) {
  .preference-example {
    border-color: CanvasText;
    outline: 2px solid CanvasText;
  }
}

prefers-reduced-transparency accepts no-preference and reduce. The recipe uses Canvas and CanvasText for an opaque surface in reduce. Preserve a readable baseline when the query is unavailable. Simulation illustrates adaptation without changing system transparency effects or establishing support.

Opaque surfaces

Opaque surfaces
<div class="preference-example">The condition adapts the style of this content.</div>
.preference-example {
  padding: 1rem;
  border: 2px solid currentColor;
}

@media (prefers-reduced-transparency: reduce) {
  .preference-example {
    background: Canvas;
    color: CanvasText;
  }
}

inverted-colors accepts none and inverted. It describes inverted output, not a dark theme; the recipe marks the condition with shape and text. Do not enable a global filter to simulate support. When adapting images or video, inspect the result with actual inversion: emulation or ordinary screenshots do not necessarily reproduce that output.

Inverted output

Inverted output
<div class="preference-example">The condition adapts the style of this content.</div>
.preference-example {
  padding: 1rem;
  border: 2px solid currentColor;
}

@media (inverted-colors: inverted) {
  .preference-example {
    border-style: dashed;
    text-decoration: underline;
  }
}

These two documents query their own context. Their iframe elements declare color-scheme: light and dark; native CSS decides the text inside without scripts. If the engine honors the embedding element’s scheme, the readings differ. External emulation can force both readings: repeat the test without it. If both follow the system, do not infer failure of the basic query: inheritance has separate support. The site theme stays unchanged.

Diagnosis: host versus iframe

color-scheme: light

color-scheme: dark

Native comparison of two embedded contexts, independent of the playground. Each text identifies the matching CSS query, not general compatibility.
Diagnosis: host versus iframe
HTML
<iframe title="Embedded document color-scheme query · color-scheme: light"
  sandbox="allow-same-origin"
  style="color-scheme: light"
  srcdoc="&lt;!doctype html&gt;&lt;html lang=&quot;en&quot;&gt;&lt;head&gt;&lt;meta charset=&quot;utf-8&quot;&gt;&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;&lt;meta name=&quot;color-scheme&quot; content=&quot;light dark&quot;&gt;&lt;link rel=&quot;icon&quot; href=&quot;data:,&quot;&gt;&lt;title&gt;Embedded document color-scheme query&lt;/title&gt;&lt;style&gt;:root {
  color-scheme: light dark;
}

.light, .dark {
  display: none;
}

@media (prefers-color-scheme: light) {
  .light {
    display: block;
  }

  .unknown {
    display: none;
  }
}

@media (prefers-color-scheme: dark) {
  .dark {
    display: block;
  }

  .unknown {
    display: none;
  }
}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;p class=&quot;unknown&quot;&gt;Not verifiable: no color-scheme query has applied.&lt;/p&gt;
&lt;p class=&quot;light&quot;&gt;Matches (prefers-color-scheme: light).&lt;/p&gt;
&lt;p class=&quot;dark&quot;&gt;Matches (prefers-color-scheme: dark).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;"></iframe>

<iframe title="Embedded document color-scheme query · color-scheme: dark"
  sandbox="allow-same-origin"
  style="color-scheme: dark"
  srcdoc="&lt;!doctype html&gt;&lt;html lang=&quot;en&quot;&gt;&lt;head&gt;&lt;meta charset=&quot;utf-8&quot;&gt;&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;&lt;meta name=&quot;color-scheme&quot; content=&quot;light dark&quot;&gt;&lt;link rel=&quot;icon&quot; href=&quot;data:,&quot;&gt;&lt;title&gt;Embedded document color-scheme query&lt;/title&gt;&lt;style&gt;:root {
  color-scheme: light dark;
}

.light, .dark {
  display: none;
}

@media (prefers-color-scheme: light) {
  .light {
    display: block;
  }

  .unknown {
    display: none;
  }
}

@media (prefers-color-scheme: dark) {
  .dark {
    display: block;
  }

  .unknown {
    display: none;
  }
}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;p class=&quot;unknown&quot;&gt;Not verifiable: no color-scheme query has applied.&lt;/p&gt;
&lt;p class=&quot;light&quot;&gt;Matches (prefers-color-scheme: light).&lt;/p&gt;
&lt;p class=&quot;dark&quot;&gt;Matches (prefers-color-scheme: dark).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;"></iframe>

Input capabilities

The primary input and the available input set can describe different capabilities.

pointer queries primary input precision: none, coarse or fine. hover queries whether the primary input supports convenient hovering: none or hover. The browser chooses that primary input and may account for accessibility. These queries do not identify a phone, establish keyboard absence or tell you which method a person is currently using.

@media (pointer: fine)

@media (pointer: fine)
<details>
  <summary class="interaction-action">Open the example content</summary>
  <p>Open this content with a click, tap, Enter or Space. Access remains available without hover or a pointer.</p>
</details>
.interaction-action {
  min-block-size: 2.75rem;
  padding: 0.5rem 1rem;
  border: 2px solid currentColor;
}

.interaction-action:focus-visible {
  outline: 2px solid Highlight;
  outline-offset: 3px;
}

@media (pointer: fine) {
  .interaction-action {
    border-width: 4px;
    border-style: double;
  }
}

@media (hover: hover)

@media (hover: hover)
<details>
  <summary class="interaction-action">Open the example content</summary>
  <p>Open this content with a click, tap, Enter or Space. Access remains available without hover or a pointer.</p>
</details>
.interaction-action {
  min-block-size: 2.75rem;
  padding: 0.5rem 1rem;
  border: 2px solid currentColor;
}

.interaction-action:focus-visible {
  outline: 2px solid Highlight;
  outline-offset: 3px;
}

@media (hover: hover) {
  .interaction-action {
    border-width: 4px;
  }
}

@media (hover: hover) {
  .interaction-action:is(:hover, :focus-visible) {
    text-decoration: underline;
  }
}

More than one true condition

any-pointer queries the set: coarse and fine can both be true; none matches only with no pointer. any-hover: hover means at least one input allows hovering; none means none do. A coarse primary input without hover can coexist with a fine pointer and hovering in the set. Keep comfortable targets when different precision rules match.

@media (any-pointer: coarse)

@media (any-pointer: coarse)
<details>
  <summary class="interaction-action">Open the example content</summary>
  <p>Open this content with a click, tap, Enter or Space. Access remains available without hover or a pointer.</p>
</details>
.interaction-action {
  min-block-size: 2.75rem;
  padding: 0.5rem 1rem;
  border: 2px solid currentColor;
}

.interaction-action:focus-visible {
  outline: 2px solid Highlight;
  outline-offset: 3px;
}

@media (any-pointer: coarse) {
  .interaction-action {
    min-block-size: 3.5rem;
    padding: 1rem;
  }
}

@media (any-hover: hover)

@media (any-hover: hover)
<details>
  <summary class="interaction-action">Open the example content</summary>
  <p>Open this content with a click, tap, Enter or Space. Access remains available without hover or a pointer.</p>
</details>
.interaction-action {
  min-block-size: 2.75rem;
  padding: 0.5rem 1rem;
  border: 2px solid currentColor;
}

.interaction-action:focus-visible {
  outline: 2px solid Highlight;
  outline-offset: 3px;
}

@media (any-hover: hover) {
  .interaction-action {
    border-width: 4px;
  }
}

@media (any-hover: hover) {
  .interaction-action:is(:hover, :focus-visible) {
    text-decoration: underline;
  }
}

The condition enhances access without gating it

Native details/summary retains click, tap, Enter and Space. Its base size stays usable; coarse increases the target. The hover enhancement also covers focus-visible, and access never disappears. The query describes a capability rather than an element’s :hover state. Do not hide actions until hover or treat hover: none as a touchscreen detector.

Coexisting conditions in the cascade

Both any-pointer rules can apply in this example. The coarse rule comes later to preserve the larger target when fine also matches. Order resolves declarations at the same priority without turning the set into an exclusive choice. The mixed simulation profile lets you inspect both matches without pretending to change hardware.

Coexisting conditions in the cascade
<details>
  <summary class="interaction-action">Open the example content</summary>
  <p>Open this content with a click, tap, Enter or Space. Access remains available without hover or a pointer.</p>
</details>
.interaction-action {
  min-block-size: 2.75rem;
  padding: 0.5rem 1rem;
  border: 2px solid currentColor;
}

.interaction-action:focus-visible {
  outline: 2px solid Highlight;
  outline-offset: 3px;
}

@media (any-pointer: fine) {
  .interaction-action {
    padding: 0.5rem 1rem;
  }
}

@media (any-pointer: coarse) {
  .interaction-action {
    min-block-size: 3.5rem;
    padding: 1rem;
  }
}

Color, HDR and output capabilities

Query color, HDR, scanning, updates and overflow of the medium presenting the document, with resolution as a reference. Changing a box does not change that medium.

Support, matching and application are separate questions. A browser may implement a feature and return false because of the device, privacy or context. The lab compares CSS and matchMedia() and separately observes the example’s actual border. Preference simulation in another mode does not participate in these readings.

color, monochrome and color-index ranges accept boolean contexts, min-/max-, comparisons and chained ranges with unitless integers. Zero matters: (monochrome: 0) can match while (monochrome) is false. Reversed endpoints remain false conditions rather than being reordered. A fractional number, a unit or an incompatible URL value restores that feature’s valid value.

Values are not always mutually exclusive. rec2020 output usually satisfies p3 and srgb; high-capability output also satisfies standard. Reading simultaneous conditions avoids reducing those capabilities to a single label. No slider turns the device into an HDR or indexed-color display.

Bits per color component, rather than total colors or a CSS palette selection. The smallest component is used if they differ. Zero means non-color output; privacy or the user agent can limit the reported precision.

@media (color >= 8)

@media (color >= 8)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (color >= 8) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

Bits per pixel in a monochrome framebuffer. Zero means the medium is not monochrome; it neither expresses a light/dark preference nor detects forced-colors. Query zero, a boolean or a range without pretending to have a monochrome panel.

@media (monochrome = 0)

@media (monochrome = 0)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (monochrome = 0) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

Number of entries in an indexed color table. Zero means the device does not use a table. It neither counts available CSS colors nor identifies a forced-colors palette. It has its own support: BCD lists Chromium 29+, Safari 8+ and no Firefox implementation.

@media (color-index = 0)

@media (color-index = 0)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (color-index = 0) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

Values: srgb, p3 and rec2020. They describe approximate user-agent and device capabilities, with cumulative matches. Matching p3 does not guarantee support for a color(display-p3 ...) declaration; use an sRGB base and @supports when using that syntax.

@media (color-gamut: srgb)

@media (color-gamut: srgb)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (color-gamut: srgb) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

Values: standard and high. Queries the combination of peak brightness, color depth and contrast the user agent and device can provide. high describes capability, rather than an active HDR mode. standard matches visual devices and can coexist with high.

@media (dynamic-range: standard)

@media (dynamic-range: standard)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (dynamic-range: standard) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

Values: standard and high, referring to the video plane. Do not substitute dynamic-range: graphics and video can have different capabilities. This example neither plays nor certifies HDR video. If no value matches, the context remains unverifiable.

@media (video-dynamic-range: standard)

@media (video-dynamic-range: standard)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (video-dynamic-range: standard) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

Values: interlace and progressive. Describes the scanning process of an appropriate output medium, such as a TV; it does not inspect a video file’s interlacing. No value may match when inapplicable. Do not interpret that as a failure or demonstrated lack of support.

@media (scan: interlace)

@media (scan: interlace)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (scan: interlace) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

Discrete values: 0 and 1; also accepts (grid). 1 describes a fixed-size character grid; 0 describes bitmap output. This does not ask whether CSS Grid is supported. min-grid and numeric ranges do not exist for this feature.

@media (grid: 0)

@media (grid: 0)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (grid: 0) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

Values: none, slow and fast. none describes a medium that does not update its representation, such as paper; slow means slow updates and fast means fast updates. It does not measure FPS, Hz or JavaScript performance or replace prefers-reduced-motion. The example stays static.

@media (update: none)

@media (update: none)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (update: none) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

Values: none, scroll and paged. Describes how the medium handles content exceeding the block axis: inaccessible overflow, scrolling or pages. It does not query an element’s overflow. paged does not validate pagination or physical printing; native printing needs its own review.

@media (overflow-block: none)

@media (overflow-block: none)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (overflow-block: none) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

Values: none and scroll for the medium’s inline axis. It does not reflect a box’s scrollWidth or overflow styles. Block/inline axes depend on the document’s writing-mode; changing overflow in the example does not change this capability.

@media (overflow-inline: none)

@media (overflow-inline: none)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (overflow-inline: none) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

M10 reference: dpi, dpcm, dppx/x and infinite for media without a resolution limit. It neither changes DPR nor universally measures physical density precisely. infinite and calc() retain their own verification limits; a false result does not establish missing support.

@media (resolution >= 2dppx)

@media (resolution >= 2dppx)
<p class="output-sample">The border changes from dashed to double when the query applies. This is a CSS signal, not a color quality or HDR test.</p>
.output-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (resolution >= 2dppx) {
  .output-sample {
    border-width: 6px;
    border-style: double;
  }
}

Recipes use a dashed base border and a conditional double border so application stays visible without relying on color. Keep a useful base presentation and add your adaptation inside @media. If you need CSS syntax such as color(display-p3 ...), also check that declaration with @supports: a gamut query does not establish parsing support.

Compatibility checked on November 3, 2026 using MDN BCD and Web Platform DX. color-index is listed as unimplemented in Firefox; video-dynamic-range is enabled by default in Firefox 100+, behind a flag in Chromium and unsupported in Safari according to BCD. These subfeatures do not inherit the media-queries badge. scan has no specific ID; general compatibility data does not detect the visitor’s browser.

Printing: styles and pages

M32 · @media print adapts a document to printed media, including PDF. Style adaptation and page fragmentation need different checks.

Print is a media type. Base rules also apply when printing unless limited to screen. @media does not increase specificity: order, layers and selectors still decide the cascade. The recipe removes only auxiliary navigation, restores block flow and preserves text and links.

Standalone document with a native recipe

Standalone document with a native recipe
<article class="print-document">
  <h1>CSS query notes</h1>
  <nav class="screen-only" aria-label="Skip to content">
    <a href="#print-section-1">Skip to content</a>
  </nav>
  <p>A reusable document preserves its content from screen to paper. Navigation is useful on screen; text and link destinations should remain available in the printed version.</p>
  <div class="print-sections" id="print-section-1" tabindex="-1">
    <section>
      <h2>Section 1</h2>
      <p>Review the content in reading order. On screen, sections use columns when space allows. For printing, the document returns to block flow and requests that each section stay together. The browser may split a block that cannot fit on a page; paper size, scale and margins change the result.</p>
      <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Media_queries/Printing">Read the printing guide</a> <span class="print-link-url">(https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Media_queries/Printing)</span></p>
    </section>
    <section>
      <h2>Section 2</h2>
      <p>Review the content in reading order. On screen, sections use columns when space allows. For printing, the document returns to block flow and requests that each section stay together. The browser may split a block that cannot fit on a page; paper size, scale and margins change the result.</p>
      <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Media_queries/Printing">Read the printing guide</a> <span class="print-link-url">(https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Media_queries/Printing)</span></p>
    </section>
  </div>
</article>
.print-document {
  font: 1rem / 1.5 system-ui;
  overflow-wrap: anywhere;
}

.print-document .print-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.print-document .print-link-url {
  display: none;
}

@media print {
  .print-document .screen-only {
    display: none;
  }
  
  .print-document .print-sections {
    display: block;
  }
  
  .print-document .print-sections section {
    break-inside: avoid;
  }
  
  .print-document h2 {
    break-after: avoid;
  }
  
  .print-document .print-link-url {
    display: inline;
  }
}

Break rules are requests to the fragmentation engine. break-inside: avoid tries to keep a section together and break-after: avoid tries to prevent a break immediately after a heading. A block larger than the printable area may split. Avoid fixed heights or overflow that clips content. @page can define page size and margins when needed; this example leaves those decisions to the native dialog.

The recipe includes the HTTPS destination as HTML text next to the link and shows it when printing. CSS only controls its visibility; the link’s name and href remain available on screen. Information does not depend on a pseudo-element. Check long URLs in the PDF and its accessible reading order.

Three separate checks. Simulation applies declarations outside @media and creates no pages. DevTools print emulation checks CSS and matchMedia(), without verifying fragmentation. Native preview displays pages according to the browser, paper and selected settings; it still does not certify physical printer output.

In the playground, choose the long document and press Open document printing. Check that “Skip to content” disappears, all text remains, URLs appear and sections follow reading order. Review the first, middle and last pages. Repeat with a different orientation or scale and cancel. After copying HTML and CSS to a standalone document, use that document’s Print menu; the CSS recipe works without JavaScript.

The button calls print() only after an explicit action and on the native iframe, never the simulation. beforeprint/afterprint indicate a request and closure rather than proof of printing. The iframe allows modals and parent access, but no scripts; readings compare CSS, matchMedia() and actual layout in that same document. A false print on screen remains “Not verifiable in this context”.

Sources checked on 3 November 2026: MDN, HTML Standard, CSSWG and MDN BCD. The media-queries badge describes the basic family; it does not certify @page, all break-* values or a visitor’s printer. The local native-preview check and its limits are recorded separately in the specification.

Scripting, windows and foldables

Query the context presenting the document. A window, a viewport and an element have different scopes.

Observe the context containing the document. This mode queries the host page. The resizable Viewport iframe contains another document with sandboxed scripts: its scripting does not represent the site. display-mode inherits the top-level mode; device-posture reflects its posture. Each value keeps its own CSS/MQL reading.

To review an available environment, select a condition and make the change yourself through browser or system controls, then observe the example again. For foldables, use a compatible emulator and identify that evidence as emulation; compare folded/continuous and both axes separately. Test an installed-context recipe in an application that already provides that context. This lab neither creates nor installs an app and does not open PiP or fullscreen.

Values: none, initial-only and enabled. They express scripting capability in this document, rather than whether this mount ran. none includes disabled scripting; initial-only allows initial execution rather than execution throughout the document lifetime and depends on the user agent. To review none, disable JavaScript and reload: the SSR guide and its example remain available; lab controls stay disabled.

@media (scripting: enabled)

Scripting enabled

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (scripting: enabled)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (scripting: enabled) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

@media (scripting: none)

No scripting

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (scripting: none)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (scripting: none) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

Values: browser, minimal-ui, standalone, fullscreen, picture-in-picture and window-controls-overlay. Queries the effective mode, which can differ from the manifest; it is not a universal installation detector. fullscreen queries document mode; :fullscreen selects the fullscreen element. Browser-UI fullscreen and macOS fullscreen can differ across engines. BCD notes browser is always true in Safari windows even with the Fullscreen API; minimal-ui never matches in Safari and standalone never matches in desktop Firefox. Do not infer all subvalues from browser.

@media (display-mode: browser)

Browser mode

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (display-mode: browser)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (display-mode: browser) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

@media (display-mode: minimal-ui)

Minimal-ui mode

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (display-mode: minimal-ui)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (display-mode: minimal-ui) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

@media (display-mode: standalone)

Standalone mode

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (display-mode: standalone)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (display-mode: standalone) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

@media (display-mode: fullscreen)

Fullscreen mode

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (display-mode: fullscreen)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (display-mode: fullscreen) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

@media (display-mode: picture-in-picture)

Document PiP

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (display-mode: picture-in-picture)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (display-mode: picture-in-picture) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

@media (display-mode: window-controls-overlay)

Window controls overlay

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (display-mode: window-controls-overlay)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (display-mode: window-controls-overlay) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

Values: continuous and folded. Posture is neither orientation nor segment count. continuous includes devices without folds and views that do not span a hinge. A folded device may still display the document in a single region. The query reflects posture in child contexts; a scriptless iframe does not turn the device into a foldable.

@media (device-posture: continuous)

Continuous posture

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (device-posture: continuous)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (device-posture: continuous) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

@media (device-posture: folded)

Folded posture

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (device-posture: folded)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (device-posture: folded) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

Integer count of side-by-side segments along the physical horizontal axis; these are not CSS Grid columns. Accepts booleans, min-/max-, comparisons and chained ranges. Negative values are false rather than converted to sizes. In the tested Chrome 156, comparisons/intervals work but min-/max- aliases do not; they are checked separately and retain a useful base. env(viewport-segment-width 0 0) and the other viewport-segment-* variables describe indexed geometry; provide a fallback, such as env(viewport-segment-width 0 0, 100vw). A border or screenshot does not validate real hinge geometry.

@media (horizontal-viewport-segments >= 2)

Two horizontal segments

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (horizontal-viewport-segments >= 2)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (horizontal-viewport-segments >= 2) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

Integer segment count along the physical vertical axis; it is neither block-size nor element height. Two vertical segments and one horizontal segment describe a different layout from two horizontal segments. Check both axes and posture independently. Segmentation is not inferred from iframe width or connected display count.

@media (vertical-viewport-segments >= 2)

Two vertical segments

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (vertical-viewport-segments >= 2)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (vertical-viewport-segments >= 2) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

Values: normal, minimized, maximized and fullscreen. Describes the window state presenting the context, separately from display-mode. In child contexts the Window Management draft requires normal, even when the top-level window is maximized. In the host it depends on platform and implementation; a false reading does not establish missing support. The lab does not minimize, maximize or restore windows.

@media (display-state: normal)

Normal window

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (display-state: normal)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (display-state: normal) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

Discrete values: true and false, rather than ranges or pixels. Queries whether the user can resize the window, not whether an element uses resize or an iframe has sliders. The draft requires true in child contexts. Shares the ChromeOS/flag limits of display-state. Neither setResizable() nor permission APIs are called.

@media (resizable: true)

Resizable window

A double border means this environment query applies; the dashed border keeps content available when it does not.

A double border means this environment query applies; the dashed border keeps content available when it does not.
@media (resizable: true)
<p class="environment-sample">A double border means this environment query applies; the dashed border keeps content available when it does not.</p>
.environment-sample {
  border: 2px dashed currentColor;
  padding: 1rem;
}

@media (resizable: true) {
  .environment-sample {
    border-width: 6px;
    border-style: double;
  }
}

Keep base content available. These recipes use a dashed border with a double-border enhancement as a minimal application witness. Replace the enhancement with your adaptation while preserving the fallback. scripting: enabled does not prove that a particular script loaded, completed or passed CSP. Do not hide essential content while waiting for that query.

Compatibility checked on November 4, 2026 using MDN BCD and Web Platform DX 3.45.0. scripting is Widely Available; display-mode values do not share full support. picture-in-picture is listed in Chrome 123+ and Firefox 151+, without Safari; this does not establish Document PiP or video PiP support. window-controls-overlay is listed in desktop Chromium 105+. Posture (Chromium 132+) and segments (138+) are limited; Safari iOS 27 only has posture behind a flag. display-state/resizable are listed as default on ChromeOS 155 and behind a flag elsewhere, without Android/Firefox/Safari. Web Platform DX 3.45.0 adds dedicated display-state and resizable IDs, both Limited; their badges query the public source without updating dependencies.

The current Media Queries 5 draft also defines display-mode: application. Default implementation was not verified in this review and BCD has no dedicated entry: it remains a future reference without an active control. Missing data does not establish a universal absence of implementation.

Observation and other uses

The grammar also appears in JavaScript, style sheets and image selection.

window.matchMedia() creates a MediaQueryList for that window’s context. Read matches for the initial state and listen for change to observe match transitions; it is not an event for every pixel. For another iframe, use its contentWindow when same-origin access allows it. Remove the same listener on teardown. JS observes the state; CSS continues to apply layout.

Observe and stop observing

Call stopObserving() when the component unmounts. Resize this example window to observe its context.

Observe and stop observing
<output id="query-match" aria-label="Condition match"></output>
const output = document.querySelector("#query-match");
const query = window.matchMedia("(width >= 600px)");

function report() {
  output.value = String(query.matches);
}

report();
query.addEventListener("change", report);

function stopObserving() {
  query.removeEventListener("change", report);
}

CSSMediaRule.conditionText and its media list describe a parsed rule, not whether it matches or wins the cascade. cssRules may throw SecurityError for cross-origin sheets. This example reads only an owned inline sheet and handles unavailable access; CSSOM is not used as a support detector.

Descriptive inspection of an owned sheet

Descriptive inspection of an owned sheet
<style id="query-sheet">
  @media (width >= 600px) {
    .card {
      display: grid;
    }
  }
</style>
const sheet = document.querySelector("#query-sheet").sheet;

try {
  const rule = sheet?.cssRules[0];
  if (typeof CSSMediaRule !== "undefined" && rule instanceof CSSMediaRule) {
    console.log(rule.conditionText);
    console.log(rule.media.mediaText);
  }
} catch (error) {
  console.log(error.name);
}

media on link or style makes sheet application conditional. A nonmatching link may still download at another priority: it is not a universal network switch. @import has a restricted position at the start of the sheet, before style rules (except @charset and layer order statements); its condition controls the import and differs from image selection.

Apply sheets according to the medium

Apply sheets according to the medium
HTML
<link rel="stylesheet" href="print.css" media="print">

<style media="(width >= 600px)">
  .card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
</style>

A conditional import at the start

A conditional import at the start
CSS
@import url("wide.css") (width >= 600px);

.card {
  display: grid;
}

In picture, source uses media and type to choose a source; img provides the fallback and alternative text. sizes describes the expected image width for selecting among srcset candidates with w descriptors: it neither applies CSS nor sets the rendered size on its own. Its conditions cannot include a type such as screen. Loading and selection follow element, cache and agent rules; do not assume all these uses prevent every download.

Image selection and expected size

Image selection and expected size
HTML
<picture>
  <source media="(width >= 600px)" srcset="coast-wide.webp" type="image/webp">
  <img src="coast-480.jpg"
    srcset="coast-480.jpg 480w, coast-960.jpg 960w"
    sizes="(width >= 600px) 50vw, 100vw"
    width="960" height="640" alt="A coastal landscape">
</picture>

Historical syntax and migration

Recognize inherited queries without adding them to new recipes.

Device dimensions

device-width · device-height · device-aspect-ratio · min-/max-

These deprecated features query the device rather than the document’s available space. Migrate to width/height/aspect-ratio for viewport decisions and container queries for component decisions. Zoom and windows make device dimensions an unsuitable basis for layout.

Deprecated media types

tty · tv · projection · handheld · braille · embossed · aural · speech

Media Queries 5 retains these names for compatibility and requires them not to match. Use all, screen or print and specific features. speech does not detect a screen reader; never depend on it to provide accessible content. only is a historical modifier rather than a new type.

Removed or earlier values

prefers-color-scheme: no-preference · prefers-contrast: forced · overflow-block: optional-paged

These are outside the current catalog. prefers-color-scheme uses light/dark and light may include no explicit preference; forced-colors queries a forced palette and may accompany prefers-contrast: custom. Use overflow-block: paged for a paginated medium. Review the original intent before replacing a condition.

Withdrawn or renamed proposals

light-level · device-radius

light-level is a withdrawn proposal rather than a feature waiting to be enabled. The former device-radius does not replace shape either. Do not infer illumination, physical radius or display shape from a theme, border-radius or screenshot.

Prefixed queries

-moz-device-pixel-ratio · -webkit-device-pixel-ratio · -webkit-min-device-pixel-ratio · -webkit-max-device-pixel-ratio · -webkit-animation · -webkit-transform-2d · -webkit-transform-3d · -webkit-transition · -ms-high-contrast

These are legacy-code references with different support and statuses; BCD does not formally deprecate every one. Prefer resolution in dppx/dpi for density, @supports for declarations and forced-colors for forced palettes. A matching alias does not establish every CSS capability or an exact physical scale.

Proposals and features outside the builder

References checked on November 4, 2026; these features are not presented as implemented by the lab.

Reduced data

prefers-reduced-data: no-preference | reduce

BCD lists Chromium behind a flag and no default support in the other major engines. It differs from Save-Data. Preserve essential content and offer an explicit resource choice rather than presenting a simulation as a system preference.

Query aliases

@custom-media --name (…) · @media (--name)

BCD lists Firefox 148 behind layout.css.custom-media.enabled, without default implementation in Chromium/Safari. PostCSS can transform aliases, but that is not browser support. The builder generates full native conditions and does not execute the associated extension API.

Environment blending

environment-blending: opaque | additive | subtractive

Media Queries 5 defines this for specific presentation contexts. This review did not verify default implementation and has no dedicated BCD entry. It is neither mix-blend-mode nor a transparent background.

Browser controls

nav-controls: none | back

A Media Queries 5 proposal without default shipping verified in this review or a dedicated BCD entry. It neither inspects a DOM Back button nor controls history.

Video-plane gamut

video-color-gamut: srgb | p3 | rec2020

Media Queries 5 defines it, but this review did not verify default implementation. color-gamut and video-dynamic-range are separate queries and cannot substitute for evidence about this plane.

Output area shape

shape: rect | round

MDN reports no browser support. A round device, clip-path or border-radius does not establish this media feature. Keep an adaptable layout without relying on it.

Preferences API

navigator.preferences · PreferenceManager · PreferenceObject

BCD Navigator lists Chromium 120 behind a flag and no Firefox/Safari support. This API is distinct from CSS queries; the lab does not use it to change or override preferences. Any future control needs separate permission, semantics and support review.

Application context

display-mode: application

The current draft lists it, but this review did not verify default shipping and BCD has no dedicated subentry. It is not an active value or an installation detector. Style queries and container APIs belong to the @container guide.

A proposal, flag or tool-transformed code does not establish default native support. Keep a useful base, verify the value and context against current sources, and avoid hiding essential content. Missing compatibility data does not establish a universal absence of implementation.

Common mistakes

Identify the symptom before changing code.

A false query looks unsupported

Expected result
Recognize syntax even when the current threshold does not match.
Cause
matches === false is being used as a support detector.
Solution
Separate known positive/negative tests, the current match and the CSS effect. Keep not verifiable when evidence is inconclusive.

Changing a div does not trigger @media

Expected result
Change the size reference.
Cause
The query reads the document viewport, not that element’s width.
Solution
Resize the correct viewport; for a component decision, consider an eligible container.

The rem threshold does not follow html

Expected result
Understand the query’s unit.
Cause
Units in media queries are being confused with units in declarations.
Solution
Check the agent’s initial font size and effective CSS px. Do not force html to change the threshold.

The query matches but layout stays unchanged

Expected result
The conditional declaration wins.
Cause
Another cascade rule wins or the selector misses the subject.
Solution
Inspect the selector and computed property; review layers, specificity and order without defaulting to !important.

The query is false; the example stays available

Expected result
Read match, support and application separately.
Cause
A false reading can be correct or unverifiable; the system might not offer that value.
Solution
Compare complementary or coexisting values with CSS and matchMedia(), without treating simulation as support evidence.

A screenshot does not validate HDR

Expected result
Understand the reported capability without treating it as a physical measurement.
Cause
dynamic-range queries capability; a screenshot, a particular display or the example’s border does not measure luminance, HDR playback or video quality.
Solution
Keep the result as an environment reading. Real playback needs appropriate content, settings and hardware; native printing will be covered in its own mode.

The simulation looks like paper but has no pages

Expected result
Check styles, breaks and content using evidence from the appropriate context.
Cause
A screen box or emulated media does not reproduce dialog fragmentation, selected scale or physical margins.
Solution
Use the comparison for styles. Open printing explicitly and check every page; validate paper and printer output through a physical test.

Resizing a box does not change resizable

Expected result
Query the window and understand which context evaluates the condition.
Cause
CSS resize changes an element; an iframe slider changes its viewport. Neither changes whether the user can resize the top-level window.
Solution
Observe the host-page query and review its ChromeOS/flag limits. The draft requires display-state: normal and resizable: true in child contexts; do not infer top-level window state from those values.

Support and compatibility

Platform status and evidence from this session answer different questions.

The badge describes range syntax, not every @media family. Independent playground tests compare CSS and matchMedia() with known true and false conditions; they do not contain the threshold you build. Verified covers those cases in the embedded document. An inconclusive test shows “Not verifiable in this context”, including when an agent restriction might be the cause.

This section covers viewport and composition. Preferences, interaction, output and environment modes have their own checks in the host page; printing uses its own isolated document. The stated origin is the document’s current environment; external emulation can modify it, and JavaScript cannot reliably identify whether DevTools enabled it. This mode applies no educational simulation. Without JavaScript the guide, recipe and SSR scene remain; diagnostics stay pending.