본문 바로가기
HTML

<label></label>

by 원더링 2021. 12. 22.

LABEL

 

 

 

인풋창에 이름을 달아주는 태그이다. 필수적으로 입력해야하는 태그는아니다.

 

 

for="" 옵션을 반드시 사용해야 한다. 내가 연결시키고자 하는 인풋창의 id값을 적어주면 된다.

 

<!-- for에 id값 user-name을 입력함으로써, 어떤 인풋창의 이름인지 명시해주었다. -->
<label for="user-name"> 이름 </label>
<input type="text" id="user-name">

'HTML' 카테고리의 다른 글

<select name=""></select>, <option value=""><option/>  (0) 2021.12.24
<input type="'Radio"/>, <input type="'Checkbox"/>  (0) 2021.12.24
<input type=""/>  (0) 2021.12.22
<form action="" method=""></form>  (0) 2021.12.22
<div></div>, <span></span>  (0) 2021.12.22