Forum How do I...?

Different page styles per page?

ikaruga
Is there a way to apply different page styles to individual pages?
To clarify, I'm of course talking about printed pages....
mikeday
Yes, but it requires the use of named pages, or the :first page selector. Currently it is not possible to select an arbitrary page, eg. the third page, and change the style.
ikaruga
Actually, there is.

A little searching on the forums and I answer my own question.

The css:

@page style1 { }
@page style2 {}

#style1 { page: style1; }
#style2 { page: style2; }


Now what you do is apply the style you want to the container for the relevant page. Ex:

<div id=#style1>
page X
</div>
<div id=#style2>
page Y
</div>


Page X will be set with page style 1 on its own page. Ditto page Y.