<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS counter-increment属性示例- 基础教程(div.cn)</title>
<style>
body {
counter-reset: section;
}
h1 {
counter-reset: category;
}
h1:before {
counter-increment: section;
content: "Section " counter(section) ". ";
}
h2:before {
counter-increment: category;
content: counter(section) "." counter(category) " ";
}
</style>
</head>
<body>
<h1>教程</h1>
<h2> HTML教程</h2>
<h2> CSS教程</h2>
<h1>参考手册</h1>
<h2> HTML标记</h2>
<h2> CSS属性</h2>
<p> <strong>注意</strong>:Internet Explorer 7和更早版本不支持<code> counter-increment </code>属性示例。 IE8仅在指定<code> <!DOCTYPE> </code>时支持此属性示例。</p>
</body>
</html>