MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla

Revision 33028 of @page

  • Revision slug: CSS/@page
  • Revision title: @page
  • Revision id: 33028
  • Created:
  • Creator: McGurk
  • Is current revision? No
  • Comment Minor style change; 1 words added, 1 words removed

Revision Content

{{ CSSRef() }}

Summary

The @page rule is used to modify some CSS properties when printing a document.

Note: you can not change all CSS properties. You can only change the margins, orphans, widows, and page breaks of the document. All other CSS properties will be ignored.

Syntax

@page :pseudo-class {
  margin:2in;
}

Examples

Please refer to the various pseudo-classes of @page for examples.

  • {{ Cssxref(":first") }}
  • {{ Cssxref(":left") }}
  • {{ Cssxref(":right") }}

Specifications

CSS 2.1 Paged media #page-selectors

Browser compatibility

Browser Lowest Version
Internet Explorer
8.0
Firefox (Gecko) 1.0
Opera
6.0
Safari (WebKit) 5.0

Revision Source

<p>{{ CSSRef() }}</p>
<h3>Summary</h3>
<p>The @page rule is used to modify some CSS properties when printing a document.</p>
<div class="note"><strong>Note:</strong> you can not change all CSS properties. You can only change the margins, orphans, widows, and page breaks of the document. All other CSS properties will be ignored.</div>
<h3>Syntax</h3>
<pre>@page :pseudo-class {
  margin:2in;
}
</pre>
<h3>Examples</h3>
<p>Please refer to the various pseudo-classes of @page for examples.</p>
<ul> <li>{{ Cssxref(":first") }}</li> <li>{{ Cssxref(":left") }}</li> <li>{{ Cssxref(":right") }}</li>
</ul>
<h3>Specifications</h3>
<p><a class=" external" href="http://www.w3.org/TR/CSS21/page.html#page-selectors" title="http://www.w3.org/TR/CSS21/page.html#page-selectors">CSS 2.1 Paged media #page-selectors</a></p>
<h3>Browser compatibility</h3>
<table class="standard-table"> <tbody> <tr> <th>Browser</th> <th>Lowest Version</th> </tr> <tr> <td rowspan="2">Internet Explorer</td> </tr> <tr> <td><strong>8.0</strong></td> </tr> <tr> <td>Firefox (Gecko)</td> <td><strong>1.0</strong></td> </tr> <tr> <td rowspan="2">Opera</td> </tr> <tr> <td><strong>6.0</strong></td> </tr> <tr> <td>Safari (WebKit)</td> <td><strong>5.0</strong></td> </tr> </tbody>
</table>
Revert to this revision