案例:CSS3 案例     状态:可编辑再运行    进入横版
x
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html>
3
<head>
4
<style type="text/css">
5
body {counter-reset:section;}
6
h1 {counter-reset:subsection;}
7
h1:before
8
{
9
counter-increment:section;
10
content:"Section " counter(section) ". ";
11
}
12
h2:before 
13
{
14
counter-increment:subsection;
15
content:counter(section) "." counter(subsection) " ";
16
}
17
</style>
18
</head>
19
20
<body>
21
22
<p><b>注释:</b>如果已规定 !DOCTYPE,那么 Internet Explorer 8 (以及更高版本)支持 counter-increment 属性。</p>
23
24
<h1>HTML tutorials</h1>

 运行结果 
 北美留学生论坛