将ol从01改为01

时间:2014-04-04 07:48:36

标签: css html-lists

使用" list-style-type:decimal-leading-zero;"

时是否可能丢失点?

我找到了一个丢失点的解决方案,但是我无法添加前导零。

ol { 
    counter-reset: item;
    list-style-type: decimal-leading-zero;
}
li { display: block; }
li:before { 
    content: counter(item) "  "; 
    counter-increment: item 
}

1 个答案:

答案 0 :(得分:5)

您可以为计数器设置list-style-type:

ol { 
    counter-reset: item;
    list-style-type: none;
}
li { display: block; }
li:before { 
    content: counter(item, decimal-leading-zero) " "; 
    counter-increment: item;
}