counter-increment
作者:不详 来源: 【大 中 小】 浏览: 添加日期:2008-12-12 我要评论(0)
CSS counter-increment 属性
定义
counter-increment 属性设置某个选取器每次出现的计数器增量。默认增量是 1。
注释:如果使用了 "display: none",则无法增加计数。如使用 "visibility: hidden",则可增加计数。
继承性:NO
说明
利用这个属性,计数器可以递增(或递减)某个值,这可以是正值或负值。如果没有提供 number 值,则默认为 1。
JavaScript 语法
CSS 属性也可通过一段 JavaScript 被动态地改变。
脚本语法:
object.style.counterIncrement="section 2"
例子
A way to number sections with "Section 1", "Section 2", "Section 3"etc.:
h1:before
{
content: "Section " counter(section) " ";
/* Add 1 to section */
counter-increment: section;
}
A way to number sections with "Section 1", "Section 3", "Section 5" etc.:
h1:before
{
content: "Section " counter(section) " ";
/* Add 2 to section */
counter-increment: section 2;
}
可能的值
| 值 | 描述 |
|---|---|
| none | 默认。选择器无计数器增量。 |
| identifier number | identifier 定义将增加计数的选择器、id 或 class。 number 定义增量。number 可以是正数、零或者负数。 |
2008.10 made by colinivy && wondger
(如果您觉得本站不错,请告诉身边的朋友,或转载到论坛、百度知道、贴吧等,记得带网址哟,不胜感激!)
〖CSS手册〗Tags:
- 上一篇:content
- 下一篇:counter-reset
相关文章
更多评论(0)..会员评论
最新评论文章
推荐专题
在线交流QQ群
- 106310407(开)
- 55427134(开)
- 2993401(开)
- 33424604(开)
- 2993401(开)
- 161512108(开)
- 161510519(开)
- 158375021(开)
- 155858414(开)
- 143309878(开)
- 16373807(开)
- 129098721(开)
- 123473199(开)
- 146991009(开)
- 135792800(开)
- 78568516(开)
