Float #box so the text wraps beside it.
Acceptance criteria
- 1.Float #box so the text wraps beside it.
CSS Tutorial · CSS Layout
These 10 tasks go with the Normal Flow 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: “Understand block flow, inline flow, formatting contexts, containing blocks, and why positioned elements use particular reference boxes. The lesson explains block and inline flow, containing blocks, formatting contexts, margin behavior, and the reference used by positioned descendants.” .
1.Pull an element out of flowexercise · easy · 10 min
Float #box so the text wraps beside it.
Passes when: Float #box so the text wraps beside it.
2.Make a block inlineexercise · easy · 10 min · practice plan
Turn #box into an inline element.
Passes when: Turn #box into an inline element.
3.Use inline-blockexercise · easy · 10 min · practice plan
Give #box inline-block so it flows inline but accepts a size.
Passes when: Give #box inline-block so it flows inline but accepts a size.
4.Remove an element from flowexercise · easy · 10 min · practice plan
Take #box out of normal flow with absolute positioning.
Passes when: Take #box out of normal flow with absolute positioning.
5.Hide without reserving spaceexercise · medium · 10 min · practice plan
Use display: none so #box takes no space at all.
Passes when: Use display: none so #box takes no space at all.
6.Fix inline used where inline-block was neededbug fix · easy · 8 min
An inline element ignores width.
Passes when: An inline element ignores width.
7.Fix visibility used to remove spacebug fix · easy · 8 min · practice plan
visibility: hidden still reserves the space.
Passes when: visibility: hidden still reserves the space.
8.Fix the missing positioning contextbug fix · easy · 8 min · practice plan
An absolute child needs a positioned ancestor.
Passes when: An absolute child needs a positioned ancestor.
9.Fix the invalid display valuebug fix · easy · 8 min · practice plan
"block-inline" is not a display value.
Passes when: "block-inline" is not a display value.
10.Fix float used to take an element out of flowbug fix · easy · 8 min · practice plan
Absolute positioning removes it fully.
Passes when: Absolute positioning removes it fully.
Between them these tasks cover Block and inline flow and Taking elements out of flow.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.