CSS @supports At-Rule

Beginner
6 examples
Updated: Nov 2026

Definition and Usage

@supports is a CSS feature query. Rules inside its block apply only when the browser accepts the tested property and value. Write a usable fallback first, then enhance it inside the query.

Progressive enhancement.

A successful parse test means the syntax is recognized; still test the resulting layout.

CSS Syntax

syntax.css
@supports (property: value) {
  /* supported styles */
}

Condition Forms

FormPurposeTry it
declarationTest one property-value pairTry it
notApply when a condition failsTry it
andRequire every conditionTry it
orRequire at least one conditionTry it
selector()Test selector syntaxTry it
fallback firstEnhance a baseline styleTry it

CSS Examples

Grid enhancement

grid.css
.cards { display: block; }
@supports (display: grid) {
  .cards { display: grid; grid-template-columns: repeat(3, 1fr); }
}
Try It Yourself

Combined conditions

combined.css
@supports (display: grid) and (gap: 1rem) {
  .cards { display: grid; gap: 1rem; }
}
Try It Yourself

Selector query

selector.css
@supports selector(:has(*)) {
  .card:has(img) { padding-top: 0; }
}
Try It Yourself

Browser Support

@supports is a browser CSS feature.

✓ Baseline · Widely available

@supports

Supported by all current major browsers.

98% Modern browsers
Google Chrome 28+
Full support
Mozilla Firefox 22+
Full support
Apple Safari 9+
Full support
Microsoft Edge 12+
Full support
@supports Widely supported

Bottom line: Safe for progressive enhancement. Browsers that do not understand the at-rule ignore its block, so keep the fallback outside.

Frequently Asked Questions

It conditionally applies CSS when the browser recognizes a tested declaration or selector.
No. It is a CSS conditional rule evaluated by the browser's CSS engine.
Yes. Use not, and, and or. Parenthesize mixed expressions to make grouping explicit.
No. It confirms parsing support, not every implementation detail or visual result.
All current major browsers support CSS feature queries.

Next: @layer

Organize cascade priority explicitly.

@layer tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful