print-css-rocks icon indicating copy to clipboard operation
print-css-rocks copied to clipboard

lesson-chapter-numbering does not consider cascading and scope

Open georgfaust opened this issue 1 year ago • 1 comments

the reset of c3 is overwritten:

h1 {
    counter-increment: c1;
    counter-reset: c3;
    counter-reset: c2;
}

should be counter-reset: c2 c3, see: https://drafts.csswg.org/css-lists/#example-2636b37c

Also the example does not address scoping and nesting, see: https://drafts.csswg.org/css-lists/#nested-counters

maybe add something like:

html {counter-reset: c1 c2 c3}

other wise a change to the html like

<body>
    <div>
        <h1>Chapter Level 1</h1>
        ...
    </div>
    <div>
        <h1>Chapter Level 1</h1>
        ...
    </div>

will create new counters (starting at 0) for each h1.

thank you for this great resource on CSS3-paged-media!

georgfaust avatar Jun 19 '23 08:06 georgfaust