Feature Queries — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the Feature Queries lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(5)
- 1
Test for a feature
easy10 minUse grid for #grid only where grid is supported.
- 2
Provide a fallback
easy10 minFlex by default, upgrading to grid where it is supported.
- 3
Negate a condition
easy10 minFall back to flex only where a made-up value is unsupported.
- 4
Combine two conditions
easy10 minUse grid only where both grid and gap are supported.
- 5
Enhance a supported layout
medium10 minGrid with a 10px gap and two fixed columns, all behind a feature test.
Find the bug(5)
- 1
Fix the misspelled rule
easy8 minThe rule is @supports, with an s.
- 2
Fix the missing parentheses
easy8 minThe tested declaration must be wrapped in parentheses.
- 3
Fix the inverted test
easy8 minWithout `not`, this asks whether a nonsense value IS supported.
- 4
Fix the missing operator
easy8 minTwo conditions are joined with `and`.
- 5
Fix the property-only test
easy8 min@supports tests a property AND a value, separated by a colon.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace