Skip to main content

Print Styles — exercises and bug fixes

5 hands-on exercises and 5 find-the-bug challenges for the Print Styles 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. 1

    Keep a block together

    easy10 min

    Stop #wrap being split across pages.

  2. 2

    Start a new page

    easy10 min

    Force a page break after #wrap.

  3. 3

    Keep the backgrounds

    easy10 min

    Tell the printer to honour #wrap's colours exactly.

  4. 4

    Avoid stranded lines

    easy10 min

    Require at least 3 lines of #text on each page.

  5. 5

    Build a print-friendly block

    medium10 min

    Unbroken, colour-accurate, with no stranded lines.

Find the bug(5)

  1. 1

    Fix the invalid value

    easy8 min

    The value is avoid.

  2. 2

    Fix the wrong break value

    easy8 min

    Starting a new page uses the value page.

  3. 3

    Fix the misspelled property

    easy8 min

    The property is print-color-adjust.

  4. 4

    Fix the value with a unit

    easy8 min

    orphans and widows count lines, so they are unitless.

  5. 5

    Fix the break on the wrong axis

    easy8 min

    This should stop the block splitting, not force a break before it.

Ready to write the code?

The editor, the automatic checks and the worked solutions open up with an account.

Open the workspace