CSS :first Selector

❮ Previous Selectors Next ❯

Example

@page :first {
  margin-left: 50%;
  margin-top: 50%;
}

p {
  page-break-after: always;
}

Meaning

The :first selector used with the @page at-rule, represents the first page of a printed document.

Note: You can't change all CSS properties with this pseudo-class. You can only change the margins, orphans, widows, and page breaks of the document. All other properties will be ignored.

Note: You may only use absolute-length units when defining the margins.

Version: CSS2




Standard Syntax

:first {
  css declarations;
}



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







❮ Previous Selectors Next ❯