The CSS @page @-rule defines a page box - a special rectangular area where content is rendered in paged media. The page area consists of the element content and the page margin area that surrounds the content. Within an @page @-rule, properties of the page box are set (margins, page layout orientation and dimensions).
The optional page label and accompanying pseudo-class determines which pages the subsequent style declarations will apply to. The allowed pseudo-classes only apply in this @page @-rule context - :first (the first page), :left (all left pages) and :right (all right pages).
CSS examples:
@page thin:first {
size:3in 8in;
}
@page {
margin:2.5cm; /* default for all pages */
}
@page :left {
margin-left:5cm; /* left pages only */
}
@page :right {
margin-right:5cm; /* right pages only */
}
@page :first {
margin-top:8cm; /* top margin on first page */
}