CSS 有一个很好的 list-style-type
值集合,有没有办法将它们用作 content: counter(steps)
的值?
我想在计数器值中使用 list-style-type: persian
。
结果是:
۱ // (one)
۲ // (two)
۳ // (three)
۴ // (four)
۵ // (five)
...
最佳答案
是的,counter()
function takes the style type as a parameter .语法如下:
counter() = counter( <ident> [, [ <counter-style> | none ] ]? )
body {
counter-reset: divs;
}
div {
counter-increment: divs;
}
div:before {
content: counter(divs, persian);
}
<div>Text</div>
<div>Text</div>
<div>Text</div>
<div>Text</div>
<div>Text</div>
关于css - 是否有 list-style-type 的 CSS 计数器等效项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36258094/