# Css计数器怎么写

**URL:** <https://forum.freemdict.com/t/topic/14505>\
**Category:** 词典装饰排版交流分享\
**Created:** [2022 年8 月 6 日 12:05 UTC](https://forum.freemdict.com/t/topic/14505 "2022-08-06T12:05:01Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

作者： ![dictsun](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/90db22/32.png) [@dictsun](https://forum.freemdict.com/u/dictsun)\
发布日期： [2022 年8 月 8 日 03:01 UTC](https://forum.freemdict.com/t/topic/14505/4 "2022-08-08T03:01:51Z")

</div>

能搭个顺风车吗？我在看[牛津中阶双解【CSS】2019.12.12](https://forum.freemdict.com/t/topic/334)  
的css  
参照您的css，我把其中相关的类似部分找了出来：  
/\*  
}  
div.explain {  
margin-left: 18px;  
counter-reset: inum pvnum;  
}  
span.id:before {  
content: counter(inum)“.”;  
counter-increment: inum;  
}  
span.phr:before{  
content: counter(pvnum)“.”;  
counter-increment: pvnum;  
}  
_/  
对相关对应标签很迷惑，只能找到  
/_  
.num {  
color:#ff7723;  
font-weight: bold;  
display: block;  
float: left;  
margin-top: 1px;  
margin-left: -18px;  
text-align: right;  
width: 10px;  
position: absolute;  
\*/  
没弄懂，能否麻烦您给注释解析下。Thank you in advance！！！  
[njzj1212css.rar](https://forum.freemdict.com/uploads/short-url/aAvhreVMD6lAd3Cunp6nqtQGc7g.rar) (1.5 KB)  
[able词条.txt](https://forum.freemdict.com/uploads/short-url/xga8t1Cr9SWemlp04GSWEYLRiUl.txt) (2.4 KB)

---

_[View the full topic](https://forum.freemdict.com/t/topic/14505)._
