CSS Syntax — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Syntax 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
Use an element selector
easy10 minColour every paragraph green.
- 2
Use a class selector
easy10 minMake the .lead paragraph 18px.
- 3
Use an id selector
easy10 minMake #title purple.
- 4
Group two selectors
easy10 minColour the heading and the paragraph teal in one rule.
- 5
Use a descendant selector
medium10 minColour paragraphs inside #wrap maroon.
Find the bug(5)
- 1
Fix the missing colon
easy8 minA property and its value are separated by a colon.
- 2
Fix the missing dot
easy8 minA class selector starts with a dot.
- 3
Fix the missing hash
easy8 minAn id selector starts with a hash.
- 4
Fix the missing comma
easy8 minWithout a comma this becomes a descendant selector.
- 5
Fix the missing semicolon
easy8 minWithout a semicolon the two declarations merge into one invalid one.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace