gpt4 book ai didi

html - 列表的 Css 计数器

转载 作者:太空宇宙 更新时间:2023-11-04 14:02:52 24 4
gpt4 key购买 nike

我正在尝试在我的有序列表中使用 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com