Свойство стиля counterReset
Пример
Измените свойство counter-reset:
document.body.style.counterReset = "section";
Определение и использование
Свойство counterReset создает или сбрасывает один или несколько счетчиков.
Свойство counterReset обычно используется вместе со свойством counterIncrement и свойством содержимого.
Поддержка браузера
Property | |||||
---|---|---|---|---|---|
counterReset | Yes | Yes | Yes | Yes | Yes |
Синтаксис
Вернуть свойство counterReset:
object.style.counterReset
Установите свойство counterReset:
object.style.counterReset = "none|name number|initial|inherit"
Значения свойств
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 |
Технические детали
Значение по умолчанию: | никто |
---|---|
Возвращаемое значение: | Строка, представляющая свойство счетчика приращения элемента. |
CSS-версия | CSS2 |
❮ Объект стиля