at-rule

@supports — CSS reference

@supports tests whether a user agent accepts a CSS feature condition. A matching condition enables its enclosed rules but does not guarantee that all behavior, bugs or accessibility implications are covered.

Formal Syntax & Structure

css syntaxcss
@supports (display: grid) { /* enhancement */ }

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>@supports</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}@supports (display: grid) {#a{color:rgb(0,100,0)}}</style><body><main id="a">Resize the viewport to explore this example.</main></body></html>
CSS Reference