Let flex items wrap onto new lines.
Acceptance criteria
- 1.Let flex items wrap onto new lines.
CSS Tutorial · CSS Flexbox
These 10 tasks go with the Flex Wrap 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 flex-wrap property controls whether flex items should stay on a single line or wrap onto multiple lines when there is not enough space in the flex container.” Read the chapter.
1.Allow wrappingexercise · easy · 10 min
Let flex items wrap onto new lines.
Passes when: Let flex items wrap onto new lines.
2.Align wrapped lines to the startexercise · easy · 10 min · practice plan
Wrap the items and pull the lines to the start.
Passes when: Wrap the items and pull the lines to the start.
3.Wrap in reverseexercise · easy · 10 min · practice plan
Use wrap-reverse.
Passes when: Use wrap-reverse.
4.Use the flex-flow shorthandexercise · easy · 10 min · practice plan
Set direction and wrap in one declaration.
Passes when: Set direction and wrap in one declaration.
5.Align wrapped linesexercise · medium · 10 min · practice plan
Wrap and centre the resulting lines.
Passes when: Wrap and centre the resulting lines.
6.Fix the misspelled propertybug fix · easy · 8 min
The property is flex-wrap, not flexwrap.
Passes when: The property is flex-wrap, not flexwrap.
7.Fix the invalid valuebug fix · easy · 8 min · practice plan
"wrapped" is not valid, so no wrapping happens at all.
Passes when: "wrapped" is not valid, so no wrapping happens at all.
8.Fix the incomplete shorthandbug fix · easy · 8 min · practice plan
flex-flow only sets the direction, so the items never wrap.
Passes when: flex-flow only sets the direction, so the items never wrap.
9.Fix align-items used for wrapped linesbug fix · easy · 8 min · practice plan
Spacing between wrapped lines uses align-content.
Passes when: Spacing between wrapped lines uses align-content.
10.Fix the wrap set on the itemsbug fix · easy · 8 min · practice plan
flex-wrap belongs on the container.
Passes when: flex-wrap belongs on the container.
Between them these tasks cover wrap and nowrap, wrap-reverse and align-content.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.