好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

CSS3的counter()用法详解_html/css_WEB-ITnose

counter()的定义和用法:
是一个函数,其主要配合content一起使用。
使用counter()来调用定义好的计数器标识符。
语法结构:

counter( ,list-style-type) 

参数解析:
(1). :counter-increment定义的属性值 ,用来告诉该文档插入的计数器标识符名称是什么。
(2).list-style-type:设置计数器的风格,有点类似于list-style-type。默认情况之下取值为十制,但你也可以重置这个样式风格,比如upper-roman或者upper-alpha等。
此参数值列表如下:

disccirclesquaredecimaldecimal-leading-zerolower-romanupper-romanlower-greeklower-latinupper-latinarmeniangeorgianlower-alphaupper-alphanoneinherit 

浏览器支持:
(1).IE浏览器支持此属性。
(2).谷歌浏览器支持此属性。
(3).火狐浏览器支持此属性。
(4).opera浏览器支持此属性。
(5).safria浏览器支持此属性。
特别说明:只有IE7或者IE7以下的浏览器不支持。
继承性:
无继承性。
实例实例:

      蚂蚁部落  ul li{list-style-type:none;}ul li{counter-increment:antzone;}ul li:before{content:counter(antzone)".";color:red;}       蚂蚁部落欢迎您    蚂蚁部落欢迎您    蚂蚁部落欢迎您    蚂蚁部落欢迎您     

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=1154

更多css3知识可以参阅:http://www.softwhy.com/css3/

查看更多关于CSS3的counter()用法详解_html/css_WEB-ITnose的详细内容...

  阅读:49次