This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

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 2023년 9월.

CSSCounterStyleRule 인터페이스의 range 속성은 range 설명자의 값을 호출하거나 지정합니다. 만일 설명자에 설정된 값이 없다면, 이 속성은 빈 문자열을 반환합니다.

문자열입니다.

예제

다음 예제는 @counter-style 의 규칙을 보여줍니다. JavaScript에서, myRules[0] 은 이 @counter-style 규칙이며, range 를 반환하면 "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"

명세서

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

브라우저 호환성