单独的ul / ol块

时间:2017-03-01 08:31:44

标签: css

是否可以使用css在单独的ul / ol块中继续编号? 1 2 3 4 5 6 ....



get

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

li::before {
    counter-increment: section;
    content: counters(section,".") " ";
}




2 个答案:

答案 0 :(得分:2)

也许你可以使用这个属性?

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

像这样的东西,你只能将它修改到有序列表中,使用反增量

此处使用的更多信息:

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

答案 1 :(得分:1)

使用此:

<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>
相关问题