mozilla

Revision 33031 of @page

  • Revision slug: CSS/@page
  • Revision title: @page
  • Revision id: 33031
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment 8 words added, 6 words removed

Revision Content

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

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 2.0 {{ CompatNo() }} 8.0 6.0 5.0
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

See also

Revision Source

<h2>Summary</h2>
<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>
<h2>Syntax</h2>
<pre>@page :pseudo-class {
  margin:2in;
}
</pre>
<h2>Examples</h2>
<p>Please refer to the various <a href="/en/CSS/Pseudo-classes" title="Pseudo-classes">pseudo-classes</a> of @page for examples.</p>
<ul> <li>{{ Cssxref(":first") }}</li> <li>{{ Cssxref(":left") }}</li> <li>{{ Cssxref(":right") }}</li>
</ul>
<h2>Specifications</h2>
<ul> <li><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></li>
</ul>
<h2>Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>2.0</td> <td>{{ CompatNo() }}</td> <td>8.0</td> <td>6.0</td> <td>5.0</td> </tr> </tbody> </table>
</div>
<div id="compat-mobile"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> </tbody> </table>
</div>
<h2>See also</h2>
<ul> <li><a href="/en/CSS_Reference" title="CSS Reference">CSS Reference</a></li> <li>{{ CSS_at_rules() }}</li>
</ul>
Revert to this revision