?
本文檔使用 php中文網(wǎng)手冊 發(fā)布
counter-increment:none | [<identifier> <integer>]+
默認(rèn)值:none
適用于:所有元素,::before, ::after, ::alternate, ::marker, ::line-marker, margin areas, @footnote areas, and @page context
繼承性:無
動畫性:否
計(jì)算值:指定值
none:阻止計(jì)數(shù)器增加
<identifier>:identifier定義一個(gè)或多個(gè)將被增加的selector,id,或者class
<integer>:定義計(jì)算器每次增加的數(shù)值,可以為負(fù)值,默認(rèn)值是1
對應(yīng)的腳本特性為counterIncrement。
Values | IE | Firefox | Chrome | Safari | Opera | iOS Safari | Android Browser | Android Chrome |
---|---|---|---|---|---|---|---|---|
Basic Support | 6.0-7.0 | 2.0+ | 4.0+ | 6.0+ | 15.0+ | 6.0+ | 2.1+ | 18.0+ |
8.0+ |
<!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="utf-8" /> <title>content-increment_CSS參考手冊_web前端開發(fā)參考手冊系列</title> <meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com, www.doyoe.com" /> <style> .test ol{margin:16px 0;padding:0;list-style:none;} .test li li:before{color:#f00;font-family:georgia,serif,sans-serif;} .counter1 li{counter-increment:testname;} .counter1 li:before{content:counter(testname)".";} .counter2 li{counter-increment:testname2 2;} .counter2 li:before{content:counter(testname2)".";} .counter3 li{counter-increment:testname3 -1;} .counter3 li:before{content:counter(testname3)".";} </style> </head> <body> <ul class="test"> <li class="counter1"> <strong>默認(rèn)時(shí)的計(jì)數(shù)器:</strong> <ol> <li>列表項(xiàng)</li> <li>列表項(xiàng)</li> <li>列表項(xiàng)</li> </ol> </li> <li class="counter2"> <strong>修改計(jì)數(shù)器每次增加的值為2:</strong> <ol> <li>列表項(xiàng)</li> <li>列表項(xiàng)</li> <li>列表項(xiàng)</li> </ol> </li> <li class="counter3"> <strong>修改計(jì)數(shù)器每次增加的值為-1:</strong> <ol> <li>列表項(xiàng)</li> <li>列表項(xiàng)</li> <li>列表項(xiàng)</li> </ol> </li> </ul> </body> </html>
點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例