Skip to content

Commit 3a70ca4

Browse files
author
howcome
committed
revising examples; reordering sections
1 parent 78a4135 commit 3a70ca4

1 file changed

Lines changed: 76 additions & 54 deletions

File tree

css-gcpm/Overview.src.html

Lines changed: 76 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3556,9 +3556,82 @@ <h3>Selecting certain named pages</h3>
35563556
</pre>
35573557
</div>
35583558

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+
<div class=example>
3568+
<pre>
3569+
article::column(2n) { /* select every other column of an article */
3570+
...
3571+
}
3572+
</pre>
3573+
</div>
3574+
3575+
<div class=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+
<div class=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+
<div class=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+
<p class=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+
<div class=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+
35593632
<h3>Page groups</h2>
35603633

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.
35623635

35633636
<table class=propdef>
35643637
<tr>
@@ -3594,7 +3667,7 @@ <h3>Page groups</h2>
35943667
<dd>The element only starts a new page group if 'page' has a named page different from the the previous element.
35953668

35963669
<dt>start
3597-
<dd>The element starts a new page group.
3670+
<dd>The element always starts a new page group.
35983671

35993672
</dl>
36003673

@@ -3604,7 +3677,7 @@ <h3>Page groups</h2>
36043677
<p>In this example, each article starts a new page group so that the first page of each article has a pink background.
36053678

36063679
<pre>
3607-
@page funky:first-page {
3680+
@page funky:first {
36083681
background: pink;
36093682
}
36103683
article {
@@ -3617,57 +3690,6 @@ <h3>Page groups</h2>
36173690

36183691
</div>
36193692

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-
<div class=example>
3628-
<pre>
3629-
article::column(2n) { /* select every other column of an article */
3630-
...
3631-
}
3632-
</pre>
3633-
</div>
3634-
3635-
<div class=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-
<div class=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-
<div class=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 */
3665-
}
3666-
}
3667-
}
3668-
</pre>
3669-
</div>
3670-
36713693

36723694
<h2>Selecting lines</h2>
36733695

0 commit comments

Comments
 (0)