Print Styles

Christian Krammer gibt einige Tips für die Erstellung von Print Styles. Was noch nicht kannte:

To define page margins, you can use @page rule to simply apply a margin all the way around the page. E.g.:

@page {
   margin: 0.5cm;
}

will set the page margin on all sides to 0.5cm. You can also adjust the margins for every other page.

@page :left {
    margin: 0.5cm;
}

You can also use the :first page pseudo-class that describes the styling of the first page when printing a document:

@page :first {
    margin: 1cm 2cm;
}

Unfortunately, @page is not supported in Firefox, but supported in Chrome 2.0+, IE 8.0+, Opera 6.0+ and Safari 5.0+. @page :first is supported only in IE8+ and Opera 9.2+.

 

bvt