当前位置: 首页 > 网络学院 > 网页制作基础教程 > CSS > CSS counter-increment属性

CSS
CSS2 Aural
CSS 单位
CSS 颜色
CSS 颜色值
CSS 颜色名称
CSS 编码与组织技巧
CSS 模块化设计思路
CSS完美兼容IE6/IE7/FF的通用方法
CSS @ Ten: 下一个重要的东西

CSS counter-increment属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 289 ::
收藏到网摘: n/a

The counter-increment property sets how much the counter increments on each occurrence of a selector. Default increment is 1.
counter-increment 属性可设置每当选择器发生时记数器所增加的值。默认值为1

Note: If "display: none" is used you should not be able to increment the counter. If "visibility: hidden" is used you should be able to increment the counter.
注意:如果使用了"display:none"那么就能够增加记数器了。如果使用的是 "visibility: hidden"那么记数器还是能够增加的。

Inherited: No
继承性:无

举例

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; 
}

可用值

描述 NN IE
none No increment of the counter in the selector
阻止计数器增加
   
identifier number The identifier defines a selector, id, or class that should increment. The number defines how much to increment. number can be a positive number,zero, or a negative number
identifier 定义一个将被增加计数的选择符(selector),id,或者class。 number 定义增加的数值。可以为负值。默认值是 1
   

评论 (0) All

登陆 | 还没注册?