Bộ đếm kiểu Đặt lại thuộc tính
Ví dụ
Thay đổi thuộc tính counter-reset:
document.body.style.counterReset = "section";
Hãy tự mình thử »Sự miêu tả
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ả về 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 có |
---|---|
Giá trị trả về: | Một Chuỗi, biểu thị thuộc tính tăng ngược của một phần tử |
Phiên bản CSS | CSS2 |