CSS Text Alignment — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Text Alignment 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
Centre a paragraph
easy10 minCentre the #text.
- 2
Align to the right
easy10 minPush #text to the right edge.
- 3
Justify a paragraph
easy10 minSpread #text to both margins.
- 4
Use logical alignment
easy10 minAlign #text to the end of the writing direction.
- 5
Align heading and body differently
medium10 minCentre the heading and justify the paragraph.
Find the bug(5)
- 1
Fix the shortened property
easy8 minThe property is text-align.
- 2
Fix the British spelling
easy8 minThe CSS value is spelled center.
- 3
Fix the invalid value
easy8 minThere is no "middle" text alignment.
- 4
Fix the margin used to centre text
easy8 minAuto margins centre a box, not its text.
- 5
Fix the alignment on the wrong element
easy8 minThe paragraph should be justified, not the heading.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace