CSS Float — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Float 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
Float left
easy10 minFloat #box to the left.
- 2
Float right
easy10 minFloat #box to the right.
- 3
Clear a float
easy10 minMake #text clear both floats.
- 4
Clear one side
easy10 minMake #text clear left floats only.
- 5
Contain floats with flow-root
medium10 minUse display: flow-root on the wrapper.
Find the bug(5)
- 1
Fix the misspelled property
easy8 minThe property is float.
- 2
Fix the wrong direction
easy8 minThe box should float right.
- 3
Fix the invalid clear value
easy8 min"all" is not a clear value; use both.
- 4
Fix clear applied to the float itself
easy8 minThe clearing belongs on the following element.
- 5
Fix the overflow hack
easy8 minUse display: flow-root instead of overflow to contain floats.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace