Bộ đếm kiểu Thuộc tính tăng dần
Ví dụ
Thay đổi thuộc tính counterIncrement:
document.getElementById("myH1").style.counterIncrement = "subsection";
Hãy tự mình thử »Sự miêu tả
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 nội dung.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
counterIncrement | Yes | Yes | Yes | Yes | Yes |
Cú pháp
Trả về 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 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 |