<legend>
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
HTML <legend>
요소는 부모 <fieldset>
콘텐츠의 설명을 나타냅니다.
시도해 보기
<fieldset>
<legend>Choose your favorite monster</legend>
<input type="radio" id="kraken" name="monster" value="K" />
<label for="kraken">Kraken</label><br />
<input type="radio" id="sasquatch" name="monster" value="S" />
<label for="sasquatch">Sasquatch</label><br />
<input type="radio" id="mothman" name="monster" value="M" />
<label for="mothman">Mothman</label>
</fieldset>
legend {
background-color: #000;
color: #fff;
padding: 3px 6px;
}
input {
margin: 0.4rem;
}
콘텐츠 카테고리 | 없음. |
---|---|
가능한 콘텐츠 | 구문 콘텐츠. |
태그 생략 | 불가능, 시작과 끝에 태그를 추가하는 것은 필수입니다. |
가능한 부모 요소 |
<fieldset> 요소. <legend> 가
첫 번째 자식이어야 합니다.
|
가능한 ARIA 역할 | 없음 |
DOM 인터페이스 | HTMLLegendElement |
특성
이 요소는 전역 특성만 포함합니다.
예제
<form>
의 예제를 참고하세요.
명세
Specification |
---|
HTML # the-legend-element |