concept

Feature detection — CSS reference

Feature detection checks a specific capability rather than identifying the browser by name. Test the exact declaration or selector needed, provide a useful fallback, and separately verify its actual behavior.

Formal Syntax & Structure

css syntaxcss
@supports (display: bytemind-unknown) { /* enhancement */ }

Working Example

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