GeoffKnagge.com

Paged Media

Information specific to paged media is placed within the curly braces of the @page { } structure. The border and padding properties are currently ignored, but margins are specified with margin-top, margin-right, margin-bottom, margin-left, and margin.

size

Valuelength length | auto | portrait | landscape | inherit
Initialauto
Example@page {size : landscape}
This property can be used to set the size or orientation of pages in a document. Lengths are horizontal and vertical respectively.

marks

Valuecrop || cross | none | inherit
Initialnone
Example@page {marks : crop cross}

This property indicates if marks should be added to indicate the edge of the page (since it may be smaller than the physical page). Available on pages with specific sizes stated, you can assign them crop marks (show where the page ends) or crop marks (used to align pages), or both.

Left, right, and first page pseduo classes

@page :left { margininfo }
@page :right { margininfo }
@page :first { margin-top: 10cm}
The above are used to specify information specific to left and right pages (for double sided printing), and for cover pages.

:left and :right properties override general page properties, and :first overrides :left and :right.

page-break-before

Valueauto | always | avoid | left | right | inherit
Inheritno
Initialauto
ExampleP {page-break-before: avoid}
This property defines whether page breaks should be made immediately before an occurance of an element. Left and right refer to pages in a double sided arangement, forcing a page break so that the next page is of the given type.

page-break-after

Valueauto | always | avoid | left | right | inherit
Inheritno
Initialauto
ExampleP {page-break-after: avoid}
This property defines whether page breaks should be made after an occurance of an element. Left and right refer to pages in a double sided arangement, forcing a page break so that the next page is of the given type.

page-break-inside

Valueauto | avoid | inherit
Inherityes
Initialauto
ExampleP {page-break-inside: avoid}
This property defines whether page breaks should be made within an occurance of an element.

page

Valuepagename | inherit
Inherityes
Initialauto
Example@page pictures {size: landscape}
IMG {page: pictures}
This allows you to name pages, and specify a particular type of page where an element should be displayed. The page name is given after @page and before its definition. The above example places IMGs on a page named "pictures".

orphans

Valueinteger | inherit
Inherityes
Initial2
Used withblock elements
Example P { orphans:3 }
This specifies the minimum number of lines of the element that must appear at the bottom of a page.

widows

Valueinteger | inherit
Inherityes
Initial2
Used withblock elements
Example P { orphans:3 }
This specifies the minimum number of lines of the element that must appear at the top of a page.
(C)opyright, Geoff Knagge.
Continued use of this site indicates your agreement to the Conditions of use and Privacy Policy.