:first

  • Revision slug: CSS/:first
  • Revision title: :first
  • Revision id: 41241
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment Link + styling; 1 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

Browser Lowest Version
Internet Explorer
8.0
Firefox (Gecko) ---
Opera
9.2
Safari (WebKit) ---

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>
<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>---</strong></td> </tr> <tr> <td rowspan="2">Opera</td> </tr> <tr> <td><strong>9.2</strong></td> </tr> <tr> <td>Safari (WebKit)</td> <td><strong>---</strong></td> </tr> </tbody>
</table><h3>See also</h3>
<ul> <li>{{ Cssxref("@page") }}</li> <li>{{ Cssxref(":left") }}</li> <li>{{ Cssxref(":right") }}</li>
</ul>
Revert to this revision