HTML Day 2
HTML ๋งํฌ ๊ด๋ จ ํ๊ทธ
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>๋งํฌ</title>
</head>
<body>
<h1>ํ์ดํผ๋งํฌ ๊ด๋ จ ํ๊ทธ</h1>
<!--aํ๊ทธ์ href ์์ฑ์ผ๋ก ๋งํฌ๋ฅผ ๋ง๋ค ์ ์๋ค. -->
<h3>aํ๊ทธ๋ฅผ ์ด์ฉํ ํ์ดํผ๋งํฌ ํ
์คํธ</h3>
<ul>
<li><a href = "test.html">test.html</a></li>
<li><a href = "html01_block_inline.html">html01</a></li>
<li><a href = "html2_title_paragraph.html">html2</a></li>
</ul>
<br/>
<h3>์นํ์ด์ง ๋งํฌ ํ
์คํธ</h3>
<ul>
<li><a href = "http://www.naver.com" target = "_blank">๋ค์ด๋ฒ</a></li>
<!--target = "_blank"๋ฅผ ํ๊ฒ ๋๋ฉด ์ํญ์์ ํ์ด์ง๊ฐ ์ด๋ฆผ -->
<!--target = "_self"==default : ๊ธฐ์กด ํญ์์ ํ์ด์ง๊ฐ ์ด๋ฆผ -->
<li><a href = "http://www.google.com" target = "_blank">๊ตฌ๊ธ</a></li>
<li><a href = "http://www.instagram.com" target = "_self">์ธ์คํ๊ทธ๋จ</a></li>
<li><a href = "http://www.29cm.com" target = "_blank">29cm</a></li>
</ul>
<br/>
<h3>ํ์ด์ง ๋ด์์ ๋งํฌ๋ฅผ ํตํ ์ด๋</h3>
<ul>
<li><a href = "#a">1๋ฒ์ผ๋ก</a></li>
<li><a href = "#b">2๋ฒ์ผ๋ก</a></li>
<li><a href = "#c">3๋ฒ์ผ๋ก</a></li>
<!-- #a, #b, #c : id์ ๊ตฌ๋ณํ๊ธฐ ์ํด #์ ๋ถ์ฌ์ค / ๋งํฌ ๋งจ ๋ค์ #a, #b, #c ์ด๋ ๊ฒ ๋ถ์ -->
</ul>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<p id = "a">1๋ฒ</p>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<p id = "b">2๋ฒ</p>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<p id = "c">3๋ฒ</p>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<p></p>
<!--<p></p>๋ฅผ ๋ค์ ๋ถ์ฌ์ฃผ๋ฉด ๊ณต๋ฐฑ์ ์ ๊ฑฐํ๊ณ 3๋ฒ์ ๋ณด์ฌ์ค-->
</body>
</html>
HTML ํ ๊ด๋ จ ํ๊ทธ
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ํ
์ด๋ธ</title>
</head>
<body>
<!--
<table> : ๊ธฐ๋ณธ์ ์ธ ํ๋ฅผ ์์ฑํด์ฃผ๋ ํ๊ทธ
<tr> : ํ์ ํ์ ๋ํ๋ด๋ ํ๊ทธ
<th> : ํ์ ์ ๋ชฉ ์
์ ๋ํ๋ด๋ ํ๊ทธ
<td> : ํ์ ์ผ๋ฐ ์
์ ๋ํ๋ด๋ ํ๊ทธ
-->
<h2>๊ธฐ๋ณธ ํ
์ด๋ธ ๋ง๋ค๊ธฐ</h2>
<table border = "1" style = "width : 300px">
<tr style = "background-color : gray">
<th>cloumn01</th>
<th>cloumn02</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</table>
<br/>
<br/>
<br/>
<table border = "1">
<caption>ํ
์ด๋ธ ์ ๋ชฉ</caption>
<colgroup>
<col width = "100px"/>
<col width = "200px"/>
<col width = "300px"/>
</colgroup>
<thead>
<tr style = "background-color : pink">
<th>์ปฌ๋ผ1</th>
<th>์ปฌ๋ผ2</th>
<th>์ปฌ๋ผ3</th>
</tr>
</thead>
<tbody>
<tr>
<td>๋ด์ฉ1</td>
<td>๋ด์ฉ2</td>
<td>๋ด์ฉ3</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>๋ด์ฉ4</td>
<td>๋ด์ฉ5</td>
<td>๋ด์ฉ6</td>
</tr>
</tfoot>
</table>
<h3>ํ
์ด๋ธ ์
๋ณํฉํ๊ธฐ</h3>
<!--
<td>ํ๊ทธ์ ์์ฑ์ ์ด์ฉํด์ ํ๊ณผ ์ด์ ํฉ์น ์ ์๋ค.
<colspan> : ์ด ํฉ์น๊ธฐ
<rowspan> : ํ ํฉ์น๊ธฐ
-->
<table border = "1">
<caption>ํ
์ด๋ธ ๋ณํฉ</caption>
<thead style = "background-color : pink">
<tr>
<th>์ปฌ๋ผ1</th>
<th>์ปฌ๋ผ2</th>
<th>์ปฌ๋ผ3</th>
<th>์ปฌ๋ผ4</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan = "2">1[์ธ๋ก ํฉ์นจ]</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td colspan = "2">5[๊ฐ๋ก ํฉ์นจ]</td>
<td>6</td>
<td>7</td>
<td>8</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan = "6">๊ฐ๋ก ์ ๋ถ ํฉ์น๊ธฐ</td>
</tr>
</tfoot>
</table>
</body>
</html>
HTML ์ด๋ฏธ์ง ๊ด๋ จ ํ๊ทธ
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>์ด๋ฏธ์ง ๊ด๋ จ ํ๊ทธ</title>
</head>
<body>
<!-- ์ด๋ฏธ์ง ์ฝ์
ํ๊ธฐ ์ํ <img>ํ๊ทธ ์ฌ์ฉ
ํ์ผ์ ๊ฒฝ๋ก : src์ด๋ผ๋ ์์ฑ
<img>ํ๊ทธ๋ ๋ซ๊ธฐ ํ๊ทธ ์ฌ์ฉX
-->
<h1>์ด๋ฏธ์ง ๊ด๋ จ ํ๊ทธ</h1>
<img src = "sample/image/river1.PNG">
<p>src ์์ฑ ๊ฒฝ๋ก๋ฅผ ์ธํ
ํ์ฌ ํ์ผ์ ๋ถ๋ฌ์จ๋ค.</p>
<hr/>
<h2>์์ฃผ ์ฌ์ฉ๋๋ ์์ฑ</h2>
<h3>alt ์์ฑ</h3>
<p>์ด๋ฏธ์ง๋ฅผ ์ฝ์ด์ฌ ์ ์์ ๊ฒฝ์ฐ ๋์ฒด๋๋ ํ
์คํธ</p>
<img alt="๊ฐ ์ฌ์ง" src="sample/image/river1.png">
<br/>
<h3>width์ height ์์ฑ</h3>
<h4>๊ณ ์ ํฌ๊ธฐ : ํ๋ฉด์ ์ฌ์ด์ฆ๊ฐ ๋ฐ๋์ด๋ ํฌ๊ธฐ๊ฐ ๋ณํ์ง ์๋๋ค.</h4>
<img src = "sample/image/flower1.PNG" width = "200px" height = "150px">
<img src = "sample/image/flower2.PNG" width = "200px" height = "150px">
<img src = "sample/image/flower3.PNG" width = "200px" height = "150px">
<br/>
<img src = "sample/image/flower4.PNG" width = "200px" height = "150px">
<img src = "sample/image/flower5.PNG" width = "200px" height = "150px">
<hr/>
<h4>๊ฐ๋ณ ํฌ๊ธฐ : ํ๋ฉด์ ์ฌ์ด์ฆ๊ฐ ๋ฐ๋๋ฉด ํฌ๊ธฐ๋ ๋ณํ๋ค.</h4>
<img src = "sample/image/flower1.PNG" width = "15%" height = "150px">
<img src = "sample/image/flower2.PNG" width = "15%" height = "150px">
<img src = "sample/image/flower3.PNG" width = "15%" height = "150px">
<br/>
<img src = "sample/image/flower4.PNG" width = "15%" height = "150px">
<img src = "sample/image/flower5.PNG" width = "15%" height = "150px">
<hr/>
<h4>์ด๋ฏธ์ง ๊ตฌ์ญ์ 2๊ฐ๋ก ๋๋์ด ๊ฐ๊ฐ ๋งํฌ๋ฅผ ์ค์ </h4>
<img src = "sample/image/river1.PNG" usemap = "#map">
<!--map ํ๊ทธ๋ก ์ด๋ฏธ์ง ๋งต์ ๋ง๋ ๋ค.(์ด๋ฏธ์ง๋งต์ด๋ ํด๋ฆญ์ ํ ์ ์๋ ์์ญ) -->
<map name = "map">
<area shape = "rect" coords = "00,00,300,500" href = "http://www.naver.com" target = "_blank">
<!-- 00,00,300,500์ผ๋ก ๋ง์ถฐ์ฃผ๋ฉด ์ผ์ชฝ์๋ง ์ค์ ๋จ -->
<area shape = "rect" coords = "300,00,628,419" href = "http://www.google.com" target = "_blank" >
</map>
</body>
</html>
HTML ๋ฏธ๋์ด ๊ด๋ จ ํ๊ทธ
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>๋ฏธ๋์ด</title>
</head>
<body>
<h3>์ค๋์ค ํ๊ทธ</h3>
<audio src="sample/audio/major.mp3" controls = "controls" autoplay = "autoplay"></audio>
<h3>๋น๋์ค ํ๊ทธ</h3>
<video src="sample/video/video1.mp4" controls = "controls"></video>
<h3>iframe</h3> <!--ํ์ด์ง ๋ด ๋ค๋ฅธ ํ์ด์ง ๋ถ๋ฌ์ฌ ์ ์์(์ ํฌ๋ธ, ๋๋ ๋ฌธ์ ๋ฑ) -->
<iframe src = "https://www.youtube.com/embed/2KtFPjSp3og" frameborder = "5" gesture = "media" allow = "encrypted-media"
allowfullscreen></iframe>
</body>
</html>
HTML form ๊ด๋ จ(input, fieldset) ํ๊ทธ
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>form01</title>
</head>
<body>
<form action = "html12_form01_res.html" method = "get">
<!--
์ ์ก(submit)์ ๋๋ ์ ๋ action์์ ์ง์ ํด์ค ๊ฒฝ๋ก(#)๋ฅผ ํตํด method์ ์ง์ ํ ๋ฐฉ์(get)์ผ๋ก
input ํ๊ทธ์ ๊ฐ์ด ์ ๋ฌ๋๋ค.
action : form ํ๊ทธ์ ์
๋ ฅ๋ ๊ฐ์ ์ ์ก๋ฐ์ ์๋ฒ์ ํด๋์ค๋ช
์ ์ง์ ํ๋ ํ๊ทธ(์์ ๋์)
method : get(์
๋ ฅ๋ ๊ฐ๋ค์ ์ฃผ์์ ํฌํจ์์ผ ์ ๋ฌ)/post(์
๋ ฅ๋ ๊ฐ๋ค์ ์จ๊ฒจ์ ์ฃผ์๋ฅผ ์ ๋ฌ)๋ก ์ ์ก๋ฐฉ์์ ์ง์ (์ ์ก๋ฐฉ์)
-->
<!-- <label>๊ฒ์ํ ๋ด์ฉ :</label>
<input type = "text" size = "15" name = "search"> <input type = "submit" value = "search">-->
<fieldset> <!--html ์์(p, input ๋ฑ๋ฑ)๋ฅผ ๋ฐ์ค๋ก ๋ฌถ์ด์ฃผ๋ ํ๊ทธ
<legend> : ํ๋์
์ ์ ๋ชฉ์ ์ ํด์ฃผ๋ ํ๊ทธ -->
<legend>ํ์๊ฐ์
</legend>
<p>์์ด๋ : <input type = "text" name = "ID" placeholder = "id"/></p>
<p>๋น๋ฐ๋ฒํธ : <input type = "password" name = "Pwd" placeholder = "password" /></p>
<p>์ด๋ฉ์ผ ์์ ์ฌ๋ถ
<input type = "radio" name = "radio" value = "y"/> ๋์
<input type = "radio" name = "radio" value = "n"/> ๊ฑฐ๋ถ
</p>
<p>๊ด์ฌ๋ถ์ผ
<input type = "checkbox" name = "cb1" value = "๋ฌ๋น์กฐ๊ฐ์ฌ" />๋ฌ๋น์กฐ๊ฐ์ฌ
<input type = "checkbox" name = "cb2" value = "์คํฌ์ธ ํ ํ " />์คํฌ์ธ ํ ํ
<input type = "checkbox" name = "cb3" value = "์ ๋ถ์ฆ์ฌ๋ฐ๊ธ" />์ ๋ถ์ฆ์ฌ๋ฐ๊ธ
</p>
<p>
<input type = "submit" value = "๊ฐ์
ํ๊ธฐ"/>
<input type = "reset" value = "์ทจ์"/>
<input type = "button" value = "๋ฒํผ"/>
</p>
<p>
<input type = "file"/>
<input type = "hidden" name = "hidden01" value = "my_hidden_value"/>
<!--ํ์ด์ง์์ ์ฃผ์๋ฅผ ๋๊ฒจ์ค ๋ hidden์ ์ฌ์ฉํด์ ๊ฐ๋ ค์ค (์ฌ์ฉ์์๊ฒ๋ ์๋ธ)-->
</p>
</fieldset>
</form>
</body>
</html>
HTML form ๊ด๋ จ(legend, label, select, option, optgroup) ํ๊ทธ
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>form02</title>
</head>
<body>
<h1>select ์์</h1>
<form action = "html12_form01_res.html" method = "get">
<fieldset>
<legend>์ฌ๋ฌ์ค ๊ธ์์์ ๋ชฉ๋ก์์</legend>
<p>
<label>๋ต๊ธ</label><br/>
<textarea rows = "5" cols = "100" name = "ta"></textarea>
</p>
<p>
<input type = "submit" value = "์ ์ก"/>
</p>
<p>
<select name = "selected01">
<option value = "html">HTML</option>
<option>CSS</option>
<option>JS</option>
<option>JQuery</option>
</select>
</p>
<p>
<select name = "select02">
<optgroup label="์์ธ"></optgroup>
<option value = "gang-nam">๊ฐ๋จ</option>
<option value = "sadang">์ฌ๋น</option>
<option value = "gu-ro">๊ตฌ๋ก</option>
<optgroup label="๊ฒฝ๊ธฐ"></optgroup>
<option value = "su-won">์์</option>
<option value = "an-yang">์์</option>
</select>
</p>
</fieldset>
</form>
</body>
</html>
Last updated
Was this helpful?