/* The start attribute on ol elements */
ol[start] {
counter-reset: list-item attr(start, integer, 1);
counter-increment: list-item -1;
}
將這個添加到CSS允許在我的測試中識別開始屬性。
編輯:不用使用開始屬性,可以對每個新的起始點使用CSS類。 缺點是,如果需要更改任何內容,這將需要更多的維護。
css:ol.start4
{
counter-reset: item 4;
counter-increment: item -1;
}
ol.start6
{
counter-reset: item 6;
counter-increment: item -1;
}
html :
- Item 1
- Item 2
- Item 1
- Item 2
- Item 3
- Item 1
- Item 2
- Item 4
- Item 1
- Item 2
- Item 5
- Item 6
- Item 7
- Item 1
- Item 2