CSSCounterStyleRule: range

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2023.

Thuộc tính range của giao diện CSSCounterStyleRule lấy và thiết lập giá trị của bộ mô tả range. Nếu bộ mô tả không có giá trị nào được thiết lập, thuộc tính này sẽ trả về một chuỗi rỗng.

Giá trị

Một chuỗi.

Ví dụ

Ví dụ sau đây cho thấy một quy tắc @counter-style. Trong JavaScript, myRules[0] là quy tắc @counter-style này, khi trả về range sẽ cho ta giá trị "2 4, 7 9".

css
@counter-style range-multi-example {
  system: cyclic;
  symbols: "\25A0" "\25A1";
  range:
    2 4,
    7 9;
}
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].range); // "2 4, 7 9"

Đặc tả kỹ thuật

Specification
CSS Counter Styles Level 3
# dom-csscounterstylerule-range

Tương thích trình duyệt