CSS Element Selector — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Element Selector 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
Target every paragraph
easy10 minMake all p elements red.
- 2
Target every div
easy10 minGive all div elements a 2px solid border.
- 3
Target a span
easy10 minMake span elements blue.
- 4
Style the body
easy10 minGive the body a 40px padding.
- 5
Combine two element rules
medium10 minMake paragraphs green and spans red.
Find the bug(5)
- 1
Fix the selector written with a dot
easy8 minAn element selector has no dot prefix.
- 2
Fix the misspelled element
easy8 min"paragraph" is not an element name.
- 3
Fix the wrong element targeted
easy8 minThe span rule was meant for paragraphs.
- 4
Fix the missing braces
easy8 minThe declaration is not wrapped in braces, so it is ignored.
- 5
Fix the missing semicolon
easy8 minWithout a semicolon the next declaration is swallowed.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace