Interview Question

What are CSS feature queries?

@supports conditionally applies CSS when the tested feature is recognized.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

CSS feature queries use @supports to test whether a user agent supports a declaration or selector. • A true condition applies the nested rules. • Conditions can use not, and, and or. • Feature queries test syntax support, not whether a feature is bug-free.

💡 Simple Example

@supports (display: grid) { .layout { display: grid; } }

⚡ Quick Revision

@supports conditionally applies CSS when the tested feature is recognized.