O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

page-policy

Values:

start | first | last

Initial value:

start

Applies to:

@counter and @string blocks

Inherited:

N/A

Computed value:

Same as declared value

Description:

Defines how to determine the value of a counter or string value with regards to a page-based element. For example, an author may define a CSS counter to express section numbers. The author then might want to have the header of every page contain the section number of the first section found on each page. This would be done using @counter secnum {page-policy: first;} (plus related CSS needed to create the counter pattern). If the desire is to use the last instance of the counter on the page, then page-policy: last would be used instead. The value start uses the value before anything is done with the page; to continue the example, it would use the counter number as carried over from the previous page, not the first instance of the counter on the current page.

Examples:

@counter chapter {page-policy: first;}
@string section-title {page-policy: start;}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required