--- title:
HTML <li>
요소는 목록의 항목을 나타냅니다. 반드시 정렬 목록({{htmlelement("ol")}}), 비정렬 목록({{htmlelement("ul")}}, 혹은 메뉴({{htmlelement("menu")}}) 안에 위치해야 합니다. 메뉴와 비정렬 목록에서는 보통 불릿으로 항목을 나타내고, 정렬 목록에서는 숫자나 문자를 사용한 오름차순 카운터로 나타냅니다.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
콘텐츠 카테고리 | 없음. |
---|---|
가능한 콘텐츠 | 플로우 콘텐츠. |
태그 생략 | 다른 <li> 요소 바로 뒤따르거나 자신이 부모의 마지막 자식인 경우 닫는 태그를 생략할 수 있습니다. |
가능한 부모 요소 | {{HTMLElement("ul")}}, {{HTMLElement("ol")}}, {{HTMLElement("menu")}} 요소. |
가능한 ARIA 역할 | {{ARIARole("menuitem")}}, {{ARIARole("menuitemcheckbox")}}, {{ARIARole("menuitemradio")}}, {{ARIARole("option")}}, {{ARIARole("presentation")}}, {{ARIARole("radio")}}, {{ARIARole("separator")}}, {{ARIARole("tab")}}, {{ARIARole("treeitem")}} |
DOM 인터페이스 | {{domxref("HTMLLIElement")}} |
이 요소는 전역 특성을 포함합니다.
value
를 지정한 항목을 뒤따르는 다른 항목은 이 값에서부터 번호를 매깁니다. value
속성은 비정렬 목록({{HTMLElement("ul")}})과 메뉴({{HTMLElement("menu")}})에서는 아무 의미가 없습니다.
value
의 사용을 중단했지만 HTML5에서 다시 도입했습니다.a
: 소문자 글자A
: 대문자 글자i
: 소문자 로마 숫자I
: 대문자 문자 숫자1
: 숫자더 자세한 예제는 {{htmlelement("ol")}}과 {{htmlelement("ul")}}을 참고하세요.
<ol> <li>first item</li> <li>second item</li> <li>third item</li> </ol>
{{EmbedLiveSample("정렬_목록")}}
<ol type="I"> <li value="3">third item</li> <li>fourth item</li> <li>fifth item</li> </ol>
{{EmbedLiveSample("사용자_지정_값을_가진_정렬_목록")}}
<ul> <li>first item</li> <li>second item</li> <li>third item</li> </ul>
{{EmbedLiveSample("비정렬_목록")}}
명세 | 상태 | 주석 |
---|---|---|
{{SpecName('HTML WHATWG', 'grouping-content.html#the-li-element', '<li>')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5 W3C', 'the-li-element.html#the-li-element', '<li>')}} | {{Spec2('HTML5 W3C')}} | |
{{SpecName('HTML4.01', 'lists.html#h-10.2', '<li>')}} | {{Spec2('HTML4.01')}} | The type attribute has been deprecated. |
{{Compat("html.elements.li")}}
<li>
요소와 유용하게 사용할 수 있는 CSS 속성