CSS Comments — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Comments 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
Comment out a rule
easy10 minDisable the red rule with a comment so the blue one applies.
- 2
Comment a single declaration
easy10 minDisable just the font-size, keeping the colour green.
- 3
Label a section
easy10 minAdd a comment above a rule that makes #title orange.
- 4
Write a multi-line comment
easy10 minUse a comment spanning lines, then make #text purple.
- 5
Keep one of two rules
medium10 minComment out the first rule so the teal one wins.
Find the bug(5)
- 1
Fix the unclosed comment
easy8 minAn unclosed comment swallows everything after it.
- 2
Fix the JavaScript comment
easy8 minCSS has no double-slash comments, so this silently disabled the font-size.
- 3
Fix the HTML comment
easy8 minCSS comments use slash-star, not angle brackets.
- 4
Fix the reversed markers
easy8 minA comment opens with slash-star and closes with star-slash.
- 5
Fix the commented-out wrong rule
easy8 minThe teal rule should survive, not the red one.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace