user1409736
user1409736

Reputation:

Separate ul / ol blocks

Is it possible to continue the numbering in separate ul / ol blocks with css? 1 2 3 4 5 6 ....

ol {
    counter-reset: section;
    list-style-type: none;
}

li::before {
    counter-increment: section;
    content: counters(section,".") " ";
}
<ol>
  <li>item</li>
  <li>item</li>
  <li>item</li>
  <li>item</li>
</ol>

<ol>
  <li>item</li>
  <li>item</li>
</ol>

Upvotes: 1

Views: 195

Answers (2)

ata
ata

Reputation: 3638

Use this:

<ol>
  <li>item</li>
  <li>item</li>
  <li>item</li>
</ol>
// use start number you want as below
<ol start="50">
  <li>item</li>
  <li>item</li>
  <li>item</li>
</ol>

Upvotes: 1

Kuba Wojtach
Kuba Wojtach

Reputation: 566

Maybe you could use this property?

https://css-tricks.com/almanac/properties/c/counter-increment/

Something like this, you could modify it onto the ordered list only, use counter-increment.

More info of the usage here:

https://developer.mozilla.org/en/docs/Web/CSS/counter-increment

Upvotes: 1

Related Questions