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: name 속성

Baseline 2023
Newly available

Since ⁨September 2023⁩, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

CSSCounterStyleRule 인터페이스의 name 속성은 연관성 있는 규칙의 name 으로 정의된 <custom-ident> 의 값을 호출하거나 지정합니다.

문자열입니다.

예제

다음 예제는 @counter-style 의 규칙을 보여줍니다. JavaScript에서, myRules[0] 은 이 @counter-style 규칙이며, name 을 반환하면 "box-corner" 값을 얻을 수 있습니다.

css
@counter-style box-corner {
  system: fixed;
  symbols: ◰ ◳ ◲ ◱;
  suffix: ": ";
  fallback: disc;
}
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].name); // "box-corner"

명세서

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

브라우저 호환성