:first

  • Revision slug: Web/CSS/:first
  • Revision title: :first
  • Revision id: 477073
  • Created:
  • Creator: kscarfone
  • Is current revision? No
  • Comment Updated tags

Revision Content

{{ CSSRef() }}

Summary

The :first page CSS 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.

 

Specification Status Comment
{{ SpecName('CSS3 Paged Media', '#left-right-first', ':first') }} {{ Spec2('CSS3 Paged Media') }} No change.
{{ SpecName('CSS2.1', 'page.html#page-selectors', ':first') }} {{ Spec2('CSS2.1') }} Initial definition.

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") }}

{{ languages( { "fr": "fr/CSS/:first" } ) }}

Revision Source

<p>{{ CSSRef() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>:first</code> <a href="/en/CSS/@page" title="@page">page</a> CSS <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>
<h2 id="Examples">Examples</h2>
<pre class="brush: css">
@page :first {
&nbsp; 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>
<h2 id=".C2.A0">&nbsp;</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('CSS3 Paged Media', '#left-right-first', ':first') }}</td>
      <td>{{ Spec2('CSS3 Paged Media') }}</td>
      <td>No change.</td>
    </tr>
    <tr>
      <td>{{ SpecName('CSS2.1', 'page.html#page-selectors', ':first') }}</td>
      <td>{{ Spec2('CSS2.1') }}</td>
      <td>Initial definition.</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">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>{{ 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>
<h2 id="See_also">See also</h2>
<ul>
  <li>{{ Cssxref("@page") }}</li>
  <li>{{ Cssxref(":left") }}</li>
  <li>{{ Cssxref(":right") }}</li>
</ul>
<p>{{ languages( { "fr": "fr/CSS/:first" } ) }}</p>
Revert to this revision