Revision 41242 of :first

  • Revision slug: CSS/:first
  • Revision title: :first
  • Revision id: 41242
  • Created:
  • Creator: McGurk
  • Is current revision? No
  • Comment Updated browser compatibility; 60 words added, 13 words removed

Revision Content

{{ CSSRef() }}

Summary

The :first page pseudo-class describes the styling of the first page 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.

Examples

@page :first {
  margin:2in 3in;
} 
Note: you may only use the absolute length units when defining the margin. Please see the page about length for more information.

Specifications

CSS 2.1 Paged media #page-selectors

Browser compatibility

{{ CompatibilityTable() }}

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

See also

  • {{ Cssxref("@page") }}
  • {{ Cssxref(":left") }}
  • {{ Cssxref(":right") }}

Revision Source

<p>{{ CSSRef() }}</p>
<h3>Summary</h3>
<p>The <code>:first</code> <a href="/en/CSS/@page" title="@page">page</a> <a href="/en/CSS/Pseudo-classes" title="Pseudo-classes">pseudo-class</a> describes the styling of the first page 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>Examples</h3>
<pre>@page :first {
  margin:2in 3in;
} 
</pre>
<div class="note"><strong>Note:</strong> you may only use the absolute length units when defining the margin. Please see the page about <a href="/en/CSS/length#Absolute_length_units" title="https://developer.mozilla.org/en/CSS/length#Absolute_length_units">length</a> for more information.</div>
<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>
<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>{{ CompatUnknown() }}</td> <td>{{ CompatNo() }}</td> <td>8.0</td> <td>9.2</td> <td>{{ CompatUnknown() }}</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>{{ CompatNo() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> </tbody> </table>
</div>
<h3>See also</h3>
<ul> <li>{{ Cssxref("@page") }}</li> <li>{{ Cssxref(":left") }}</li> <li>{{ Cssxref(":right") }}</li>
</ul>
Revert to this revision