Stop #wrap being split across pages.
Acceptance criteria
- 1.Stop #wrap being split across pages.
CSS Tutorial · CSS Output & Performance
These 10 tasks go with the Print Styles 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: “Prepare documents for paper and PDF with print media rules, page breaks, and sensible URL treatment. It covers print media queries, page margins, fragmentation, hiding interface chrome, conserving ink, and preserving destination URLs.” .
1.Keep a block togetherexercise · easy · 10 min
Stop #wrap being split across pages.
Passes when: Stop #wrap being split across pages.
2.Start a new pageexercise · easy · 10 min · practice plan
Force a page break after #wrap.
Passes when: Force a page break after #wrap.
3.Keep the backgroundsexercise · easy · 10 min · practice plan
Tell the printer to honour #wrap's colours exactly.
Passes when: Tell the printer to honour #wrap's colours exactly.
4.Avoid stranded linesexercise · easy · 10 min · practice plan
Require at least 3 lines of #text on each page.
Passes when: Require at least 3 lines of #text on each page.
5.Build a print-friendly blockexercise · medium · 10 min · practice plan
Unbroken, colour-accurate, with no stranded lines.
Passes when: Unbroken, colour-accurate, with no stranded lines.
6.Fix the invalid valuebug fix · easy · 8 min
The value is avoid.
Passes when: The value is avoid.
7.Fix the wrong break valuebug fix · easy · 8 min · practice plan
Starting a new page uses the value page.
Passes when: Starting a new page uses the value page.
8.Fix the misspelled propertybug fix · easy · 8 min · practice plan
The property is print-color-adjust.
Passes when: The property is print-color-adjust.
9.Fix the value with a unitbug fix · easy · 8 min · practice plan
orphans and widows count lines, so they are unitless.
Passes when: orphans and widows count lines, so they are unitless.
10.Fix the break on the wrong axisbug fix · easy · 8 min · practice plan
This should stop the block splitting, not force a break before it.
Passes when: This should stop the block splitting, not force a break before it.
Between them these tasks cover Page breaks, print-color-adjust and Orphans and widows.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.