CSS 将罗马数字样式应用于计数器输出
示例
的CSS
body {
counter-reset: item-counter;
}
.item {
counter-increment: item-counter;
}
.item:before {
content: counter(item-counter, upper-roman) ". "; /* by specifying the upper-roman as style the output would be in roman numbers */
}的HTML
<div class='item'>Item No: 1</div> <div class='item'>Item No: 2</div> <div class='item'>Item No: 3</div>
在上面的示例中,计数器的输出将显示为I,II,III(罗马数字),而不是通常的1、2、3,因为开发人员已明确指定了计数器的样式。
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短