码迷,mamicode.com
首页 > 其他好文 > 详细

计数器

时间:2017-04-04 01:04:23      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:服务器   before   增量   服务   设置   title   oct   网页   doc   

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style>
/*1、声明/复位计数器*/
/*1、声明/复位计数器*/
body{
counter-reset:c1 0;
}
/*2、设置计数器增量(变化范围)*/
h1{
counter-increment:c1 1;
/*将 c2 计数器复位成 0*/
counter-reset:c2 0;
}
p{
counter-increment:c2 1;
}
/*3、使用计数器*/
h1:before{
content:counter(c1)"、";
margin-right:10px;
}
p:before{
content:counter(c1)"."counter(c2)"、";
margin-right:10px;
}

</style>
</head>
<body>
<h1>WEB基础知识</h1>
<p>WEB简介</p>
<p>HTTP协议</p>
<p>浏览器与服务器</p>
<h1>HTML快速入门</h1>
<p>WEB简介</p>
<p>HTTP协议</p>
<p>浏览器与服务器</p>
<h1>网页中的文本</h1>
<p>WEB简介</p>
<p>HTTP协议</p>
<p>浏览器与服务器</p>
</body>
</html>

计数器

标签:服务器   before   增量   服务   设置   title   oct   网页   doc   

原文地址:http://www.cnblogs.com/zhangailing/p/6664048.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!