CSS @page Media

@page :

The @page CSS at-rule is used to modify some CSS properties when printing a document.You can't change all CSS properties with @page. You can only change the margins, orphans, widows, and page breaks of the document. Attempts to change any other CSS properties will be ignored.

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

@page { size : portrait }
@page rotated { size : landscape }

Controlling Widows and Orphans

The orphans property specifies the minimum number of lines of a paragraph that must be left at the bottom of a page.
The widows property specifies the minimum number of lines of a paragraph that must be left at the top of a page.

<style type="text/css">
   @page{orphans:4; widows:2;}
</style>

Comments

Popular posts from this blog

Bootstrap Breakpoints