Add a paragraph with a centred class instead of a center element.
Acceptance criteria
- 1.Add a paragraph with a centred class instead of a center element.
HTML Tutorial · HTML Tags
These 10 tasks go with the HTML <center> Tag 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 tag was used to horizontally center-align content in HTML. It is deprecated in HTML5 and should be replaced by CSS styling ( text-align: center; ) for modern web development.” .
1.Centre with a classexercise · easy · 10 min
Add a paragraph with a centred class instead of a center element.
Passes when: Add a paragraph with a centred class instead of a center element.
2.Centre a headingexercise · easy · 10 min · practice plan
Give a heading a class you would centre with CSS.
Passes when: Give a heading a class you would centre with CSS.
3.Centre a blockexercise · easy · 10 min · practice plan
Wrap content in a div that carries the centring class.
Passes when: Wrap content in a div that carries the centring class.
4.Centre an imageexercise · easy · 10 min · practice plan
Give a figure the centring class.
Passes when: Give a figure the centring class.
5.A centred bannerexercise · medium · 10 min · practice plan
Build a centred section with a heading and a paragraph.
Passes when: Build a centred section with a heading and a paragraph.
6.Fix the center elementbug fix · easy · 8 min
center is obsolete; use a class and CSS.
Passes when: center is obsolete; use a class and CSS.
7.Fix the centred headingbug fix · easy · 8 min · practice plan
Replace the obsolete wrapper with a class on the heading.
Passes when: Replace the obsolete wrapper with a class on the heading.
8.Fix the align attributebug fix · easy · 8 min · practice plan
The align attribute was removed from HTML5.
Passes when: The align attribute was removed from HTML5.
9.Fix the centred imagebug fix · easy · 8 min · practice plan
Wrap the image in a figure with a class.
Passes when: Wrap the image in a figure with a class.
10.Fix the banner using centerbug fix · easy · 8 min · practice plan
Use a section with a class instead.
Passes when: Use a section with a class instead.
Between them these tasks cover Deprecated elements, Centring with CSS and Semantics.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.