CSS计数器counter-reset/counter-increment两个命名并存测试实例页面
回到相关文章 »代码:
CSS代码:
.counter { counter-reset: wangxiaoer 2 wangxiaosan 3; counter-increment: wangxiaoer wangxiaosan; font-size: 24px; font-family: arial black; color: #cd0000; } .counter:before { content: counter(wangxiaoer); } .counter:after { content: counter(wangxiaosan); }
HTML代码:
<strong>我叫王小二,万万没想到,下面要出现2个数字:</strong> <p class="counter"></p> <strong>前小三,后小四;显然,中间是岳父!</strong>
效果:
我叫王小二,万万没想到,下面要出现2个数字:
前小三,后小四;显然,中间是岳父!