## counter-reset 属性
### 属性定义及使用说明
counter-reset属性创建或重置一个或多个计数器。
counter-reset属性通常是和counter-increment属性,content属性一起使用。
JavaScript 语法:object.style.counterReset="subsection"
* * *
## 属性值
| 值 | 说明 |
| :-- | :-- |
| none | 默认。不能对选择器的计数器进行重置 |
| *id number* | id 定义重置计数器的选择器、id 或 class。 number 可设置此选择器出现次数的计数器的值。可以是正数、零或负数。 |
| inherit | 规定应该从父元素继承 counter-reset 属性的值 |
* * *
## 实例--对部分和子部分进行编号(比如 "Section 1"、"1.1"、"1.2")的方法:
```
<!DOCTYPE html>
<html>
<head>
<style>
body {counter-reset:section;}
h1 {counter-reset:subsection;}
h1:before
{
counter-increment:section;
content:"Section " counter(section) ". ";
}
h2:before
{
counter-increment:subsection;
content:counter(section) "." counter(subsection) " ";
}
</style>
</head>
<body>
<p><b>Note:</b> IE8 supports these properties only if a !DOCTYPE is specified.</p>
<h1>HTML tutorials</h1>
<h2>HTML Tutorial</h2>
<h2>XHTML Tutorial</h2>
<h2>CSS Tutorial</h2>
<h1>Scripting tutorials</h1>
<h2>JavaScript</h2>
<h2>VBScript</h2>
<h1>XML tutorials</h1>
<h2>XML</h2>
<h2>XSL</h2>
</body>
</html>
```
- CSS常用样式控制
- background--背景
- Text--文本
- CSS属性
- align-*
- animation-*
- appearance
- backface-visibility
- background
- background-attachment
- background-blend-mode
- background-clip
- background-color
- background-image
- background-origin
- background-position
- background-repeat
- background-size
- border
- border-bottom
- border-bottom-color
- border-bottom-left-radius
- border-bottom-right-radius
- border-bottom-style
- border-bottom-width
- border-collapse
- border-color
- border-image
- border-image-outset
- border-image-repeat
- border-image-source
- border-image-width
- Border-left
- border-left-color
- border-left-style
- border-left-width
- border-image-slice
- border-radius
- border-right
- border-right-color
- border-right-style
- border-right-width
- border-spacing
- border-style
- border-top
- border-top-color
- border-top-left-radius
- border-top-right-radius
- border-top-style
- border-top-width
- border-width
- bottom
- box-shadow
- box-sizing
- caption-side
- clear
- clip
- color
- column-count
- column-gap
- column-rule
- column-rule-color
- column-rule-style
- column-rule-width
- column-span
- column-width
- columns
- content
- counter-increment
- counter-reset
- cursor
- direction
- display
- Empty-cells
- filter(滤镜)
- CSS 伪元素选择器
- :active 选择器
- :after 选择器
- :before 选择器
- :checked 选择器
- :disabled 选择器
- :empty 选择器
- :enabled 选择器
- :first-child 伪元素
- :first-letter 伪元素
- :first-line 伪元素
- :first-of-type 选择器
- :focus 选择器
- :hover 选择器