Centre the #text.
Acceptance criteria
- 1.Centre the #text.
CSS Tutorial · CSS Text & Fonts
These 10 tasks go with the CSS Text Alignment chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “The CSS Text Alignment property is used to control the horizontal alignment of text inside an element.” Read the chapter.
1.Centre a paragraphexercise · easy · 10 min
Centre the #text.
Passes when: Centre the #text.
2.Align to the rightexercise · easy · 10 min · practice plan
Push #text to the right edge.
Passes when: Push #text to the right edge.
3.Justify a paragraphexercise · easy · 10 min · practice plan
Spread #text to both margins.
Passes when: Spread #text to both margins.
4.Use logical alignmentexercise · easy · 10 min · practice plan
Align #text to the end of the writing direction.
Passes when: Align #text to the end of the writing direction.
5.Align heading and body differentlyexercise · medium · 10 min · practice plan
Centre the heading and justify the paragraph.
Passes when: Centre the heading and justify the paragraph.
6.Fix the shortened propertybug fix · easy · 8 min
The property is text-align.
Passes when: The property is text-align.
7.Fix the British spellingbug fix · easy · 8 min · practice plan
The CSS value is spelled center.
Passes when: The CSS value is spelled center.
8.Fix the invalid valuebug fix · easy · 8 min · practice plan
There is no "middle" text alignment.
Passes when: There is no "middle" text alignment.
9.Fix the margin used to centre textbug fix · easy · 8 min · practice plan
Auto margins centre a box, not its text.
Passes when: Auto margins centre a box, not its text.
10.Fix the alignment on the wrong elementbug fix · easy · 8 min · practice plan
The paragraph should be justified, not the heading.
Passes when: The paragraph should be justified, not the heading.
Between them these tasks cover text-align, Justified text and Logical alignment.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.