In CSS, while using the
@page pseudo-class the order in which it's definied is not always important. Four pages are made each with a seperate color, the pages are called in order within the
<body>,we are able to specify the conditions for selecting four page masters that each have a different background color:
- For the only page in its page sequence, a page with no background color.
- For the first page in its page sequence, a page with a blue background.
- For the last page in its page sequence, a page with a pink background.
- For a page that is not the first page and not the last page in its page sequence, a page with a yellow background.
This page is the only page in its page sequence (because the following page is the start of a new page sequence), so this page has no background color.
The following three pages have blue, yellow, and pink background colors, respectively, because of their positions in the second page sequence.
For the first page in its page sequence, a page with a blue background.
For a page that is not the first page and not the last page in its page sequence, a page with a yellow background.
For the last page in its page sequence, a page with a pink background.