<img src="./images/pizza.png" alt="피자">
<!-- 상대경로 -->
<img src="./images/pizza.png" alt="피자">
<!-- 절대경로 -->
<img src="C:/users/document/images/pizza.png" alt="피자">
<img src="http://www.naver.com/pizza.png" alt="피자">
하나의 table은 하나 이상의 tr로 이루어져 있으며, tr은 셀을 나타내는 th, td를 자식으로 가지게 된다.
표를 구성할 때는 위에서 아래로, 좌측에서 우측으로 작성하면 된다.
<html>
<body>
<table border=2>
<thead>
<tr>
<th>이름</th> <th>성별</th> <th>주소</th><th>회비</th>
</tr>
</thead>
<tbody>
<tr>
<td>평경장</td> <td>남</td> <td rowspan="2">청주</td><td>1000원</td>
</tr>
<tr>
<td>정마담</td> <td>여</td> <td>500원</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3">합계</td><td>1500원</td>
</tr>
</table>
</body>
</html>
단순한 텍스트
를 입력할 때 사용<input type="text" placeholder="ㅇㅇㅇ">
<input type="password">
<input type="radio" name="gender"> 남자
<input type="radio" name="gender"> 여자
<input type="checkbox" name="hobby"> 발라드
<input type="checkbox" name="hobby"> 댄스
<input type="checkbox" name="hobby"> 힙합
<input type="file">
<form action="./test.html">
메시지: <input type="text" name="message"><br>
<input type="submit">
<input type="reset">
<input type="image" src="http://placehold.it/50x50?text=click" alt="click" width="50" height="50">
<input type="button" value="버튼">
</form>
이름 | 기능 |
---|---|
submit | form의 값을 전송하는 버튼 |
reset | form의 값을 초기화하는 버튼 |
image | 이미지를 삽입할 수 있는 버튼 |
button | 아무 기능이 없는 버튼 |
<select>
<option>서울</option>
<option>경기</option>
<option>강원</option>
...
</select>
<textarea rows="5" cols="30">
...
</textarea>
textarea에는 텍스트 상자의 크기를 조절하는 rows
, cols
속성이 있다.
cols : 가로 크기를 조절하는 속성(한 줄에 들어가는 글자의 수, 수치의 의미는 평균적인 글자의 너비로 정확히 글자 수를 나타내지는 않습니다.)
rows : 세로 크기를 조절하는 속성(화면에 보여지는 줄 수)
<button type="submit|reset|button">ㅇㅇㅇ</button>
빈 태그가 아니라서
내용을 안에 직접 넣을 수 있으므로 좀 더 자유로운 스타일 표현이 가능하다.form 요소의 이름
과 form 요소
를 명시적으로 연결시켜주기 위해 사용한다.<label for="name">이름</label>: <input type="text" id="name"><br>
<label for="nickname">이름</label>: <input type="text" id="nickname"><br>
<label for="address">이름</label>: <input type="text" id="address"><br>
form 요소의 id 속성값과 label의 for 속성값을 같게 적어주어야 한다.
<fieldset>
<legend>기본 정보</legend>
... 폼 요소들 ...
</fieldset>
<fieldset>
<legend>부가 정보</legend>
... 폼 요소들 ...
</fieldset>
form 요소들을 감싸는 태그
로 데이터를 묶어서 실제 서버로 전송해준다.<form action="" method="">
<fieldset>
<legend>기본 정보</legend>
... 폼 요소들 ...
</fieldset>
<fieldset>
<legend>부가 정보</legend>
... 폼 요소들 ...
</fieldset>
</form>