Thuộc tính bộ đếm kiểu dáng
Thí dụ
Thay đổi thuộc tính counterIncrement:
document.getElementById("myH1").style.counterIncrement = "subsection";
Định nghĩa và Cách sử dụng
Thuộc tính counterIncrement tăng một hoặc nhiều giá trị bộ đếm.
Thuộc tính counterIncrement thường được sử dụng cùng với thuộc tính counterReset và thuộc tính content.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
counterIncrement | Yes | Yes | Yes | Yes | Yes |
Cú pháp
Trả lại thuộc tính counterIncrement:
object.style.counterIncrement
Đặt thuộc tính counterIncrement:
object.style.counterIncrement = "none|id|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
none | Default value. No counters will be incremented |
id number | The id defines which counter that should be incremented. The number sets how much the counter will increment on each occurrence of the selector. The default increment is 1. 0 or negative values, are allowed. If the id refers to a counter that has not been initialized by counter-reset, the default initial 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