<li>
HTML <li>
요소는 목록의 항목을 나타냅니다. 반드시 정렬 목록(<ol>
), 비정렬 목록(<ul>
, 혹은 메뉴(<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.
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> 요소 바로 뒤따르거나 자신이 부모의 마지막 자식인 경우 닫는 태그를 생략할 수 있습니다. |
가능한 부모 요소 | <ul> , <ol> , <menu> 요소. |
가능한 ARIA 역할 | menuitem , menuitemcheckbox , menuitemradio , option , presentation , radio , separator , tab , treeitem |
DOM 인터페이스 | HTMLLIElement |
특성
이 요소는 전역 특성을 포함합니다.
value
<ol>
요소 내부에서 항목의 현재 서수 값을 나타내는 정수. 리스트가 로마 숫자나 문자로 표시되더라도 이 특성에는 숫자만 넣을수 있습니다.value
를 지정한 항목을 뒤따르는 다른 항목은 이 값에서부터 번호를 매깁니다.value
속성은 비정렬 목록(<ul>
)과 메뉴(<menu>
)에서는 아무 의미가 없습니다.참고: HTML4에서는value
의 사용을 중단했지만 HTML5에서 다시 도입했습니다.type
- 넘버링 타입을 나타내는 문자.
a
: 소문자 글자A
: 대문자 글자i
: 소문자 로마 숫자I
: 대문자 문자 숫자1
: 숫자
<ol>
요소에서 지정하는 유형을 덮어씁니다.참고: 이 속성은 사용 중단됐습니다. 대신 CSSlist-style-type
(en-US) 속성을 사용하세요.
예제
정렬 목록
<ol>
<li>first item</li>
<li>second item</li>
<li>third item</li>
</ol>
사용자 지정 값을 가진 정렬 목록
<ol type="I">
<li value="3">third item</li>
<li>fourth item</li>
<li>fifth item</li>
</ol>
비정렬 목록
<ul>
<li>first item</li>
<li>second item</li>
<li>third item</li>
</ul>
명세
명세 | 상태 | 주석 |
---|---|---|
HTML Living Standard The definition of '<li>' in that specification. |
Living Standard | |
HTML5 The definition of '<li>' in that specification. |
Recommendation | |
HTML 4.01 Specification The definition of '<li>' in that specification. |
Recommendation | The type attribute has been deprecated. |
브라우저 호환성
BCD tables only load in the browser