Bộ đếm kiểu dáng Thuộc tính đặt lại
Thí dụ
Thay đổi thuộc tính đặt lại bộ đếm:
document.body.style.counterReset = "section";
Định nghĩa và Cách sử dụng
Thuộc tính counterReset tạo hoặc đặt lại một hoặc nhiều bộ đếm.
Thuộc tính counterReset thường được sử dụng cùng với thuộc tính counterIncrement và thuộc tính content.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
counterReset | Yes | Yes | Yes | Yes | Yes |
Cú pháp
Trả lại thuộc tính counterReset:
object.style.counterReset
Đặt thuộc tính counterReset:
object.style.counterReset = "none|name number|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
none | Default value. No counters will be reset |
name | The name defines which counter that should be reset |
number | The id defines which counter that should be reset. The number sets the value the counter is set to on each occurrence of the selector. The default reset value is 0 |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Chi tiết kỹ thuật
Giá trị mặc định: | không ai |
---|---|
Giá trị trả lại: | Một chuỗi, đại diện cho thuộc tính đối số tăng của một phần tử |
Phiên bản CSS | CSS2 |
❮ Đối tượng phong cách