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 幼儿狗年祝福语大全简短
18 好听的元旦简短祝福语