HTML๐จ/html&css ํผ์์
html form , input ์์ ์ ๋ฆฌ
hyojinny
2022. 10. 10. 02:45
ํผ์์css
<form> | ๋ฌธ์์ ๊ตฌํ ์ง์ ๋ก๊ทธ์ธ, ํ์๊ฐ์ , ๊ธ์ฐ๊ธฐ ๋ฑ๋ฑ ์นํ์ด์ง ๋ด์์ ์ฌ์ฉ์๋ก๋ถํฐ ์ ๋ ฅ์ ๋ฐ์ ๋ ์ฌ์ฉํ๋ค. ์๋ฒ๋ก ๋ฐ์ดํฐ๋ฅผ ์ ๋ฌ์ ์ฒ๋ฆฌํ ์ ์๋๋ก ๊ธฐ๋ฅ |
ํผ ์ ๋ ฅ์์ | <form action="๋ฐ์ดํฐ๋ฅผ ๋ณด๋ผ ํ์ผ ์์น" method="๋ฐ์ดํฐ ์ ์ก ๋ฐฉ๋ฒ" name="ํผ์ ์ด๋ฆ" |
<fieldset> | form ์์ฑ์ ํ์! form ์์์์ ์ฐ๊ด๋ ์์๋ค์ ํ๋์ ๊ทธ๋ฃน์ผ๋ก ๋ฌถ์๋ ์ฌ์ฉ |
<legend> | fieldset ์์ ํ์ ํ๊ทธ ์์ฑ๋๋ form ์ ์ ๋ชฉ์ค์ |
tabel ํผ ์์ฑ์ ์์
<form>
<fieldset>
<legend>๋ฌธ์ ์์ฑํ๊ธฐ</legend>
<table>
<caption>๋ฌธ์ ์์ฑํ๊ธฐ ํ
์ด๋ธ</caption>
<tr>
<th class="col01">์ด๋ฆ</th>
<td><input type="text" readonly value="๋ฐํจ์ง"></td>
</tr>
</table>
</fieldset>
</form>
input type ์์ฑ | |
password | ์ฌ์ฉ์๋ก๋ถํฐ ๋น๋ฐ๋ฒํธ๋ฐ๊ธฐ (*๋๋ ๋๊ทธ๋ผ์ด๋ชจ ํ์๊ฐ ๊ฐ๋ ค์ง) |
radio | ์ฌ๋ฌ๊ฐ ์ต์
์ค ํ๋์ ์ต์
์ฒดํฌ ๋ฐ๋์ ๋ชจ๋ ์ฌ๋ฌ๊ฐ์ input ์์์ name ์์ฑ์ด ๊ฐ์์ผํจ checked : ์ฌ๋ฌ๊ฐ์ ์ต์ ์ค์ ๋ฏธ๋ฆฌ ์ ํ๋๋ ์ต์ ์ง์ ๊ฐ๋ฅ <input class="blind" id="fruit1" type="radio" name="fruit" checked>
|
checkbox | ์ฌ์ฉ์๋ก๋ถํฐ ์ฌ๊ฑฐ๊ฐ ์ต์
์ค ๋ค์์ ์ต์
์ ์
๋ ฅ ๋ฐ์ ์ ์๋ค. ๋ง์ฐฌ๊ฐ์ง๋ก |
file | ์ฌ์ฉ์๋ก๋ถํฐ ํ์ผ์ ์ ์ก ๋ฐ์ ์ ์๋ค. |
text | ์ฌ์ฉ์๊ฐ ๋ด์ฉ์ ์
๋ ฅํ ์ ์๋ค. textarea placeholer ์ค ๋ฐ๊ฟ์ html entity ๋ฌธ์ ์ฌ์ฉ |
button | ๋ฒํผ์ ์ ์ (๋์์ธ์ ๊ธฐ๋ณธ์ผ๋ก๋์ด) |
์์ฑ๋ฒ |
<input class="input_file" type="text" readonly title="ํ์ผ๋ช
">
|
์ฃผ์์ฌํญ | - ์ฒดํฌ๋ฐ์ค, ๋ผ๋์ค, file type๋ฑ์ ๋ชจ์๋ณ๊ฒฝ์ด ๋ถ๊ฐํ๋ฏ๋ก label:before๋ฅผ ์ด์ฉ - ๋ธ๋ผ์ฐ์ ํ๊ฒฝ๋ง๋ค ๋์์ธ์ด ๋ค๋ฅด๋ฏ๋ก ์ด๊ธฐํ ์ฝ๋์ฌ์ฉ |
์ถ๊ฐ readonly | input ํ๊ทธ์ ์ฌ์ฉํ๋ ์์ฑ (textarea ํ๊ทธ๋ ๊ฐ๋ฅ) ์ ๋ ฅ์ฐฝ์ ๋ด์ฉ์ ๋ณ๊ฒฝ ํ ์ ์๊ฒ๋ ์ฝ๊ธฐ์ ์ฉ์ผ๋ก ๋ง๋ค๋ ์ฌ์ฉ ์) ์ด๋ฆ์ ๋จผ์ ์ ๋ ฅํด ๋๋ |
* input ์์ ์น ์ ๊ทผ์ฑ class ๋ช bilnd |
ํ๋ฉด์ ๋ํ๋์ง ์์ง๋ง ์๊ฐ์ฅ์ ์ธ์ ์ํ ๋ฆฌ๋๊ธฐ์ ์ฝํ๊ฒ ํ๊ธฐ ์ํด์ class ๋ช ์ bilnd ๋ก ์ง์ ํ๋ค. |
๋๋ถ๋ถ caption, label, legnd ๋ฑ์ ์๋ณด์ด๊ฒ ์ฒ๋ฆฌ |
์ํ ์ ์น ์ ๊ทผ์ฑ ์๋ฐ |
display:none ์ฌ์ฉ์ ์์์ฅ์ ์ธ๋ ์ฝ์ง ๋ชปํจ. |
ํ๊ทธ๋ค ์์
<input type="text" readonly value="๋ฐํจ์ง" title="์ด๋ฆ์
๋ ฅ">
<td><input type="text" readonly title="์ฐ๋ฝ์ฒ ์
๋ ฅ"></td>
<input class="input_small" type="text" readonly title="์ด๋ฉ์ผ">
<input type="text" placeholder="์ ๋ชฉ์ ์
๋ ฅํด์ฃผ์ธ์" title="์ ๋ชฉ์
๋ ฅ">
<textarea rows="10"
placeholder="๊ฐ๋งน์ ์ ์ฒญ๊ณผ ๊ด๋ จ๋ ๋ฌธ์์ฌํญ์ ์์ฑํด ์ฃผ์ธ์. ๋ฌธ์ํ์ค ๋ด์ฉ์ ๊ตฌ์ฒด์ ์ผ๋ก ์์ฑํด ์ฃผ์๋ฉด ๋์ฑ ๋น ๋ฅด๊ณ ์ ํํ ๋ต๋ณ์ ๋๋ฆด ์ ์์ต๋๋ค."
title="๋ด์ฉ์
๋ ฅ"></textarea>