You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-gcpm/Overview.src.html
+76-54Lines changed: 76 additions & 54 deletions
Original file line number
Diff line number
Diff line change
@@ -3556,9 +3556,82 @@ <h3>Selecting certain named pages</h3>
3556
3556
</pre>
3557
3557
</div>
3558
3558
3559
+
3560
+
<h3>Selecting elements within pages and columns</h3>
3561
+
3562
+
3563
+
<p>The 'page()' and 'column()' pseudo-element allows the selection of
3564
+
pages, columns, and elements within.
3565
+
3566
+
3567
+
<divclass=example>
3568
+
<pre>
3569
+
article::column(2n) { /* select every other column of an article */
3570
+
...
3571
+
}
3572
+
</pre>
3573
+
</div>
3574
+
3575
+
<divclass=example>
3576
+
<pre>
3577
+
article::page(left) { /* select all left pages in an article */
3578
+
background: pink;
3579
+
}
3580
+
</pre>
3581
+
</div>
3582
+
3583
+
3584
+
<divclass=example>
3585
+
<pre>
3586
+
article::page(left) p { /* select all p elements that appear on left pages in an article */
3587
+
text-align: left;
3588
+
}
3589
+
</pre>
3590
+
</div>
3591
+
3592
+
<p>It is also possible to place the code inside @page:
3593
+
3594
+
<divclass=example>
3595
+
<p>These are identical:
3596
+
3597
+
<pre>
3598
+
@page :left {
3599
+
{
3600
+
p { text-align: left }
3601
+
}
3602
+
}
3603
+
3604
+
::page(left) p { text-align: left }
3605
+
</pre>
3606
+
</div>
3607
+
3608
+
<pclass=issue>Is "left" a pseudo-class or pseudo-element? In @page, ":left" is a pseudo-class. However, when we select elements on left pages, it acts like a pseudo-element.</p>
3609
+
3610
+
</div>
3611
+
3612
+
<divclass=example>
3613
+
<pre>
3614
+
@page :left {
3615
+
background: pink; /* declaration applies to pages */
3616
+
{
3617
+
p { text-align: left } /* declaration applies to elements on page */
3618
+
}
3619
+
@top-center {
3620
+
background: orange; /* declaration applies to margin box */
3621
+
{
3622
+
p { text-align: left } /* declaration applies to elements in margin box */
3623
+
}
3624
+
}
3625
+
}
3626
+
</pre>
3627
+
</div>
3628
+
3629
+
3630
+
3631
+
3559
3632
<h3>Page groups</h2>
3560
3633
3561
-
<p>Named pages can appear in sequence, stemming from different elements. A sequnce of named pages is called a <em>page group</em>. The 'page-group' property expresses whether an element starts a new page group or not.
3634
+
<p>Named pages can appear in sequence, stemming from different elements. A sequnce of named pages with the same name is called a <em>page group</em>. The 'page-group' property expresses whether an element starts a new page group or not.
3562
3635
3563
3636
<tableclass=propdef>
3564
3637
<tr>
@@ -3594,7 +3667,7 @@ <h3>Page groups</h2>
3594
3667
<dd>The element only starts a new page group if 'page' has a named page different from the the previous element.
3595
3668
3596
3669
<dt>start
3597
-
<dd>The element starts a new page group.
3670
+
<dd>The element always starts a new page group.
3598
3671
3599
3672
</dl>
3600
3673
@@ -3604,7 +3677,7 @@ <h3>Page groups</h2>
3604
3677
<p>In this example, each article starts a new page group so that the first page of each article has a pink background.
3605
3678
3606
3679
<pre>
3607
-
@page funky:first-page {
3680
+
@page funky:first {
3608
3681
background: pink;
3609
3682
}
3610
3683
article {
@@ -3617,57 +3690,6 @@ <h3>Page groups</h2>
3617
3690
3618
3691
</div>
3619
3692
3620
-
<h3>'page' and 'column' pseudo-elements</h3>
3621
-
3622
-
3623
-
<p>The 'page()' and 'column()' pseudo-element allows the selection of
3624
-
pages, columns, and elements within.
3625
-
3626
-
3627
-
<divclass=example>
3628
-
<pre>
3629
-
article::column(2n) { /* select every other column of an article */
3630
-
...
3631
-
}
3632
-
</pre>
3633
-
</div>
3634
-
3635
-
<divclass=example>
3636
-
<pre>
3637
-
article::page(left) { /* select all left pages in an article */
3638
-
background: pink;
3639
-
}
3640
-
</pre>
3641
-
</div>
3642
-
3643
-
3644
-
<divclass=example>
3645
-
<pre>
3646
-
article::page(left) p { /* select all p elements that appear on left pages in an article */
3647
-
text-align: left;
3648
-
}
3649
-
</pre>
3650
-
</div>
3651
-
3652
-
<p>It is also possible to place the code inside @page:
3653
-
3654
-
<divclass=example>
3655
-
<pre>
3656
-
@page :left {
3657
-
background: pink; /* declaration applies to pages */
3658
-
{
3659
-
p { text-align: left } /* declaration applies to elements on page */
3660
-
}
3661
-
@top-center {
3662
-
background: orange; /* declaration applies to margin box */
3663
-
{
3664
-
p { text-align: left } /* declaration applies to elements in margin box */
0 commit comments