CSS为list-style-type
提供了很好的值集合,有没有办法将它们用作content: counter(steps)
的值?
我想在计数器值中使用list-style-type: persian
。
结果将是:
۱ // (one)
۲ // (two)
۳ // (three)
۴ // (four)
۵ // (five)
...
答案 0 :(得分:2)
是的,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>