# HG changeset patch # User Simon Sapin # Date 1360637219 28800 # Node ID 2a7cb1ed8232d33fe319b38e5a131d32ef82f138 # Parent b2d87226b3e3a1bfbddb2ea0822ee29476717468 [css3-page] Clarify 'counter-increment' vs. the 'page' counter. diff -r b2d87226b3e3 -r 2a7cb1ed8232 css3-page/Overview.html --- a/css3-page/Overview.html Mon Feb 11 17:45:58 2013 -0800 +++ b/css3-page/Overview.html Mon Feb 11 18:46:59 2013 -0800 @@ -2062,25 +2062,6 @@ content in page-margin boxes. This is useful for maintaining a page count. -
-

The following rules result in the placement of the current page - number in the middle of the outside margin of each page. - -

-@page {
-margin: 10%;
-counter-increment: page;
-
-@top-center {
-  font-family: sans-serif;
-  font-weight: bold;
-  font-size: 2em;
-  content: counter(page);
-}
-}
-
-
-

A ‘counter-increment’ within either a page or margin context causes the counter to increment with the generation of each page box. @@ -2101,19 +2082,46 @@ break. Use of the counter in this way does not affect the calculation of the counter's value. -

A counter named ‘page’ - is automatically created and incremented on every page of the document. - Specifically, the UA must automatically create and increment such a - counter as if ‘@page { counter-increment: page; - }’ were specified. The implied ‘page’ counter is a real counter, and can be - directly affected using the ‘ A counter named ‘page’ + is automatically created and incremented by 1 on every page of the + document, unless the ‘counter-increment’ + property in the page context + explicitly specifies a different increment for the ‘page’ counter. The implied + ‘page’ counter is a real + counter, and can be directly affected using the ‘counter-increment’ and ‘counter-reset’ properties when named explicitly in those properties. It can also be used in the ‘counter()’ and ‘counters()’ function forms. +

+

The following rules result in the placement of the current page + number in the middle of the outside margin of each page. + +

+@page {
+  margin: 10%;
+
+  @top-center {
+    font-family: sans-serif;
+    font-weight: bold;
+    font-size: 2em;
+    content: counter(page);
+  }
+}
+
+ +

Adding the following rule will make all pages even-numbered. + +

+@page {
+  counter-increment: page 2;
+}
+
+
+

Additionally, a counter named ‘pages’ is automatically created by the UA. Its value is always the total number of pages in the document. (In diff -r b2d87226b3e3 -r 2a7cb1ed8232 css3-page/Overview.src.html --- a/css3-page/Overview.src.html Mon Feb 11 17:45:58 2013 -0800 +++ b/css3-page/Overview.src.html Mon Feb 11 18:46:59 2013 -0800 @@ -1565,25 +1565,6 @@ rule, and used as content in page-margin boxes. This is useful for maintaining a page count.

-
- -

The following rules result in the placement of the current page number in the -middle of the outside margin of each page.

-
-@page {
-margin: 10%;
-counter-increment: page;
-
-@top-center {
-  font-family: sans-serif;
-  font-weight: bold;
-  font-size: 2em;
-  content: counter(page);
-}
-}
-
-
-

A 'counter-increment' within either a page or margin context causes the counter to increment with the generation of each page box.

@@ -1603,13 +1584,40 @@ flow that spans the page break. Use of the counter in this way does not affect the calculation of the counter's value.

-

A counter named ''page'' is automatically created and incremented on every -page of the document. Specifically, the UA must automatically create and -increment such a counter as if ''@page { counter-increment: page; }'' were -specified. The implied ''page'' counter is a real counter, and can be directly -affected using the 'counter-increment' and 'counter-reset' properties when -named explicitly in those properties. It can also be used in the 'counter()' -and 'counters()' function forms.

+

+ A counter named ''page'' is automatically created + and incremented by 1 on every page of the document, + unless the 'counter-increment' property in the page context + explicitly specifies a different increment for the ''page'' counter. + The implied ''page'' counter is a real counter, + and can be directly affected using the 'counter-increment' and 'counter-reset' properties + when named explicitly in those properties. + It can also be used in the 'counter()' and 'counters()' function forms. +

+ +
+

The following rules result in the placement of the current page number in the +middle of the outside margin of each page.

+
+@page {
+  margin: 10%;
+
+  @top-center {
+    font-family: sans-serif;
+    font-weight: bold;
+    font-size: 2em;
+    content: counter(page);
+  }
+}
+
+ +

Adding the following rule will make all pages even-numbered.

+
+@page {
+  counter-increment: page 2;
+}
+
+

Additionally, a counter named ''pages'' is automatically created by the UA. Its value is always the total number of pages in the document. (In continuous