CSS :first Pseudo-class
Example
Selects the first page when printing:
@page :first {
margin-left: 40%;
margin-top: 50%;
}
Try it Yourself »
Definition and Usage
The :first
pseudo-class is used to select
and style the first page of a printed document.
Tip: The :first
pseudo-class is used with the @page rule.
Note: The following properties can be used with :first:
- margin properties
- orphans
- widows
- page-break properties
Version: | CSS3 |
---|
Browser Support
The numbers in the table specifies the first browser version that fully supports the pseudo-class.
Pseudo-class | |||||
---|---|---|---|---|---|
:first | 18 | 12 | 116 | 6 | 9.2 |
CSS Syntax
@page
:first {
css declarations;
}
Related Pages
CSS Reference: :left
CSS Reference: :right