在此示例中,如何更改计数器的字体大小:
<style>
p
{
counter-increment: myIndex;
}
p:before
{
content:counter(myIndex);
}
</style>
网页内容
<p>First make a variable (myIndex) and make it increase every time a p element occurs.</p>
<p>Then insert the counter in front of all p elements</p>
<p><b>Note:</b> For the counter property to work in IE8, a DOCTYPE must be declared.</p>
http://www.w3schools.com/cssref/tryit.asp?filename=trycss_content_counter
答案 0 :(得分:1)
只需设置font-size
伪造的:before
。
p {
counter-increment: myIndex;
}
p:before {
content:counter(myIndex);
font-size:30px;
}