스타일 listStyleType 속성
예시
목록 항목 마커 유형을 "upper-roman"으로 변경합니다.
document.getElementById("myList").style.listStyleType = "upper-roman";
정의 및 사용
listStyleType 속성은 목록 항목 마커 유형을 설정하거나 반환합니다.
브라우저 지원
Property | |||||
---|---|---|---|---|---|
listStyleType | Yes | Yes | Yes | Yes | Yes |
통사론
listStyleType 속성을 반환합니다.
object.style.listStyleType
listStyleType 속성을 설정합니다.
object.style.listStyleType = value
속성 값
Value | Description |
---|---|
armenian | The marker is traditional Armenian numbering |
circle | The marker is a circle |
cjk-ideographic | The marker is plain ideographic numbers |
decimal | The marker is a number. This is default for <ol> |
decimal-leading-zero | The marker is a number with leading zeros (01, 02, 03, etc.) |
disc | The marker is a filled circle. This is default for <ul> |
georgian | The marker is traditional Georgian numbering |
hebrew | The marker is traditional Hebrew numbering |
hiragana | The marker is traditional Hiragana numbering |
hiragana-iroha | The marker is traditional Hiragana iroha numbering |
katakana | The marker is traditional Katakana numbering |
katakana-iroha | The marker is traditional Katakana iroha numbering |
lower-alpha | The marker is lower-alpha (a, b, c, d, e, etc.) |
lower-greek | The marker is lower-greek |
lower-latin | The marker is lower-latin (a, b, c, d, e, etc.) |
lower-roman | The marker is lower-roman (i, ii, iii, iv, v, etc.) |
none | No marker is shown |
square | The marker is a square |
upper-alpha | The marker is upper-alpha (A, B, C, D, E, etc.) |
upper-latin | The marker is upper-latin (A, B, C, D, E, etc.) |
upper-roman | The marker is upper-roman (I, II, III, IV, V, etc.) |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
기술적 세부 사항
기본값: | <ul>의 경우 "디스크", <ol>의 경우 "십진수" |
---|---|
반환 값: | 목록의 유형을 나타내는 문자열 |
CSS 버전 | CSS1 |
더 많은 예
예시
다양한 목록 스타일 유형:
var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("myList").style.listStyleType = listValue;
예시
목록 항목 마커 유형을 반환합니다.
alert(document.getElementById("myList").style.listStyleType);
관련 페이지
CSS 튜토리얼: CSS 목록
CSS 참조: list-style-type 속성
HTML DOM 참조: listStyle 속성
❮ 스타일 개체