用CSS3来添加项目编号

h1{
  counter-increment:mycounter;    //若不加此段,则编号都是0
}
h1:before{
  content:counter(mycounter);
  content:"第" counter(mycounter) "章";             //也可以加入中文,用双引号引起来即可
  content:"第"counter(mycounter,upper-roman)"章 ";  //这里会显示成:第I章  第II章  第III章
}    

 

posted @ 2016-01-18 14:17  那谁家的丫头  阅读(426)  评论(0编辑  收藏  举报