728x90

[정의]

label 태그는 input 태그를 정의하기 위한 태그

해당 label이 설명하는 입력창이 활성화 또는 체크됨(text인경우 입력창 활성화, selectbox인 경우 체크가됨)

 

[형식]

<label for="id값">

 

- 함께 쓰이는 input 태그

 

HTML input type="week"

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

 

[예시]

 

<label for="description">설명  </label>
 <input type="text" id="description">

 

728x90
728x90

input 태그는 주로 form 태그 안에 많이 쓰인다.

속성들이 많지만 아래 자주 쓰이는 속성들을 정리했다.

 

 

1. 자주 쓰이는 속성

<input type="text"> : 기본 텍스트 입력 상자

<input type="image"> : 기본 이미지 입력 상자

<input type="file"> : 기본 파일 입력 상자

<input type="button"> : 버튼

<input type="checkbox"> : 체크박스

<input type="password"> : 패스워드 입력상자 

<input type="submit"> : 폼 전송 버튼

 

 

 

2. input 태그의 사용 예시

아래 세가지 태그를 이용해 사이트 회원가입 화면을 만들 수 있다.

 

<input type="text"> 

<input type="password">

<input type="submit"> 

 

* placeholder 태그는 박스 안에 텍스트를 넣을 수 있는 태그이다.

 

 

적용하면 아래와 같은 화면이 나온다.

728x90

+ Recent posts