css
<style>
ol>li {
list-style-type:none;
counter-increment:item;
}
ol>li:before {
width:1.5em;
font-weight:bold;
content:counter(item) ".";
}
</style>
<html>
<ol>
<li>a</li>
<li>b</li>
<li>c</li>
</ol>
</html>
run result:
1.a
2.b
3.c
note: :before 是指设置 'content'的内容样式。
counter 是动态设置li的序列样式,item-->:before item.
相关推荐
jiedinghui 2020-10-25
Ladyseven 2020-10-22
zuncle 2020-09-28
xiaohuli 2020-09-02
葉無聞 2020-09-01
nicepainkiller 2020-08-20
AlisaClass 2020-08-09
myloveqiqi 2020-08-09
buttonChan 2020-08-02
drdrsky 2020-07-29
Ladyseven 2020-07-25
nicepainkiller 2020-07-24
AlisaClass 2020-07-19
hellowzm 2020-07-19
background-color: blue;background-color: yellow;<input type="button" value="变蓝" @click="changeColorT
昔人已老 2020-07-19
骆驼的自白 2020-07-18
lanzhusiyu 2020-07-19
hellowzm 2020-07-19
CSSEIKOCS 2020-07-18