Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pagedjs
pagedjs
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 144
    • Issues 144
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 8
    • Merge Requests 8
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Tools
  • pagedjspagedjs
  • Issues
  • #12

Closed
Open
Opened Apr 29, 2018 by Julie Blanc@JulieBlanc
  • Report abuse
  • New issue
Report abuse New issue

counter-reset on splited elements

❗ All the following remarks apply to all elements (block or inline elements) with other elements inside and not only on section

For now, if a counter is reset on the section, the counter will reset on each page.

The counter reset works correctly on body. But with this, if the we have several following sections, the counter will not be reset to zero at each section.


HTML

<section>
  <p>This is the paragraph 1…</p>
  <p>This is the paragraph 2…</p>
  <p>This is the paragraph 3…</p>
  <p>This is the paragraph 4…</p>
  <p>This is the paragraph 5…</p>
</section>

CSS

section {
  counter-reset: paragraph
}

section p {
  counter-increment: paragraph;
}

section p:before {
  content : "before " counter(paragraph) ;
}

What you get with this code:

Capture_d_écran_2018-05-01_à_05.12.48

What we want (CORRECT)

Capture_d_écran_2018-05-01_à_05.15.06

Edited May 01, 2018 by Julie Blanc
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
4
Labels
CSS In Review Parsing Priority
Assign labels
  • View project labels
Reference: tools/pagedjs#12