--- id: css-supports title: "CSS @supports" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["@supports", "feature queries", "CSS feature query", "supports rule", "progressive enhancement CSS", "browser feature detection CSS"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.89 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "at-rule", "progressive-enhancement"] raw_sources: ["https://www.w3schools.com/css/css_supports_rule.asp"] applied_in: [] github_commit: "" --- # [[CSS @supports]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The `@supports` rule (a feature query) checks whether the browser supports a specific CSS property or value and applies styles only when it does, letting you define fallbacks for unsupported features. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`@supports` rule** β€” lets you check if the browser supports a specific CSS property or value, and define fallback styles if the feature is not supported. [S1] - **Conditional application** β€” useful for applying styles only when the browser can handle them. [S1] - **Operators** β€” you can use `and`, `or`, and `not` for multiple conditions. [S1] - **Negation** β€” `not` applies styles only when a feature is not supported. [S1] - **Fallback rule (Note)** β€” always provide fallback styles outside of `@supports`, for older browsers. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Test then enhance** β€” write base/fallback styles normally, then wrap the enhanced styles in `@supports (property: value) { ... }`. [S1] - **Combine conditions** β€” chain feature tests with `and`/`or` (e.g. `(display: grid) and (gap: 10px)`). [S1] - **Negative guard** β€” use `@supports not (...)` to style a warning or fallback path when a feature is absent. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) The `@supports` rule lets you check if the browser supports a specific CSS property or value, and to define fallback styles if the feature is not supported. This is useful for applying styles only when the browser can handle them. [S1] **Basic syntax** [S1] ```css @supports (property: value) { /* CSS rules to apply if condition is true */ } ``` **Example β€” flex fallback** [S1] ```css /* use this CSS if the browser does not support display: flex */ .container { float: left; width: 100%; } /* use this CSS if the browser supports display: flex */ @supports (display: flex) { .container { display: flex; } } ``` **Example β€” grid fallback** [S1] ```css /* use this CSS if the browser does not support display: grid */ .container { display: table; width: 90%; background-color: #2196F3; padding: 10px; } /* use this CSS if the browser supports display: grid */ @supports (display: grid) { .container { display: grid; grid: auto; grid-gap: 10px; background-color: #2196F3; padding: 10px; } } ``` **Negating with `not`** β€” you can use `not` to apply styles only when a feature is not supported: [S1] ```css @supports not (display: grid) { .warning { background-color: pink; padding: 10px; border: 1px solid red; } } ``` **Combining conditions** β€” you can use `and`, `or`, and `not` for multiple conditions: [S1] ```css @supports (display: grid) and (gap: 10px) { .container { display: grid; gap: 10px; } } ``` **Note:** Always provide fallback styles outside of `@supports`, for older browsers. [S1] **Reference table** [S1] | At-rule | Description | |---------|-------------| | `@supports` | Used to test whether a browser supports a CSS feature | ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's applied cases are progressive-enhancement layouts: a float fallback enhanced to flex, a table fallback enhanced to grid, a `not`-guarded warning box, and a combined `(display: grid) and (gap: 10px)` query. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Feature query with fallback (language: CSS): ```css .container { float: left; width: 100%; } @supports (display: flex) { .container { display: flex; } } ``` Negative feature query: ```css @supports not (display: grid) { .warning { background-color: pink; padding: 10px; border: 1px solid red; } } ``` Combined conditions: ```css @supports (display: grid) and (gap: 10px) { .container { display: grid; gap: 10px; } } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.89 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Grid 12-column Layout]], [[CSS RWD Intro]], [[CSS Grid Align]] - **μ°Έμ‘° λ§₯락:** Browser feature detection for safely adopting newer CSS layout features with fallbacks. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS @supports β€” https://www.w3schools.com/css/css_supports_rule.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS @supports" page (Astra wiki-curation, P-Reinforce v3.1 format).