CSS Reference Pseudo-class

:blank

:blank is a CSS pseudo-class selector used to select pages of a printed document, such as a book, that are empty as a result of a forced page break.

It is used in conjunction with the @page rule which selects all pages in a printed document. So, when used with @page, :blank acts kind of like a filter used to select only the empty pages that are empty as a result of a forced page break.

@page :blank {
    /* styles for the empty page */
}
                

Only the left and right values of the page-break-before and page-break-after properties can generate pages that match :blank.

Styles specified in a :blank @page rule override any styles provided in an @page rule that has no pseudo-class specified.

Also, styles specified in a :blank @page rule override any styles provided in :left and :right @page rules. (:left and :right are selectors used to select the left pages and the right pages of a double-sided printed document, such as a book. See the :left and :right entries for more information.)

It is important to note that you cannot change all CSS properties inside an @rule. See the @page entry for more information on what styles can be changed and/or applied.

Trivia & Notes

The page-break-before and page-break-after properties will be replaced with break-before and break-after properties, respectively, in a future CSS level.

Official Syntax

@page :blank {
    /* styles for the empty page */
}                
                

Examples

Since only margins, orphans, widows, and page breaks can be styled inside an @page rule, styling any of these for a blank page does not make sense.

However, in CSS3, at-rules that select and target page margins were introduced. They have no browser support at this time. But the following is an example of how you might style an empty page using a page margin at-rule; the example inserts content into the center of the top margin of an empty page:

@page :blank {
  @top-center { content: "This page is intentionally left blank" }
}
                

More information about this will be provided once available.

Browser Support

:blank was introduced in CSS Level 3 and is still fairly new. Its browser support is yet to be determined.

Written by

Last updated July 1, 2015 at 12:39 pm by Pedro Botelho

Do you have a suggestion, question or want to contribute? Submit an issue.