CSS3中伪元素::before和::after
/*CSS*/ul li{ list-style: none; counter-increment: number;} //number相当于是个变量,随便取名就好,在伪元素中调用ul li::before{ content: counter(number)"."; font-weight: bold;} //注意这里不同于JS,counter(number)与"."之间不需要加任何东西,直接连接就好 |
|
1
2
3
4
5
6
7
|
/*HTML*/<p>我的爱好:</p><ul> <li>吃饭</li> <li>睡觉</li> <li>打豆豆</li></ul> |
除了这个cjk-ideographic,你还可以使用更多CSS中 list-style-type 属性
浙公网安备 33010602011771号