我正在尝试在我的有序列表中使用 css 中的计数器增量,但它不起作用
这是我要显示的内容:
1. Acknowledgements
1.1 blah, blah ....
1.2 blah, blah ....
1.3 blah, blah ....
2. Risk Statement
2.1 blah, blah ....
2.2 blah, blah ....
2.3 blah, blah ....
3. License
3.1 blah, blah ....
3.2 blah, blah ....
3.3 blah, blah ....
但这就是正在发生的事情... http://jsfiddle.net/XQKcy/
最佳答案
Demo Fiddle
你们非常亲密:
body {
counter-reset: listCounter;
}
ol {
counter-increment: listCounter;
counter-reset: itemCounter;
list-style:none;
}
li{
counter-increment: itemCounter;
}
li:before {
content: counter(listCounter) "." counter(itemCounter);
left:10px;
position:absolute;
}
关于html - 列表的 Css 计数器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23267039/