์ค์ต ๋ก๊ทธ์ธ์ฐฝ, ๊ฒ์ํ, ํ์๊ฐ์
์ฐฝ ๋ง๋ค๊ธฐ
2023. 2. 9. 17:01ใCSS
๋ก๊ทธ์ธ์ฐฝ
<!DOCTYPE html>
<html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <style type="text/css"> .container{ background-color: #f2f2f2; /* div์ ๋๋น ์ค์ด๊ธฐ */ /* ํฌ๊ธฐ ๋ณ๊ฒฝ ๊ฐ๋ฅํ๋ ํ ์ค ์ฐจ์ง ์ฑ์ง์ ๊ทธ๋๋ก ์ ์ง!!! */ width : 400px; /* ์ธ๋ก ๊ธธ์ด๋ ๋ด์ฉ๋งํผ ์๋ ๋์ด์ง */ /* padding : div ๊ธฐ์ค์ผ๋ก ์ ์ชฝ ์ฌ๋ฐฑ ์ง์ */ /* padding-left: 30px; */ /* magin : div ๊ธฐ์ค์ผ๋ก ๋ฐ๊นฅ์ชฝ ์ฌ๋ฐฑ ์ง์ */ /* margin-top: 50px; */ /* ๊ทธ๋ฅ margin ์์ชฝ ๋ฐฉํฅ ๋ชจ๋ ์กฐ์ ๊ฐ๋ฅ(๊ฐ๋ก) */ margin: 0 auto; /* margin : ์ํ์ฌ๋ฐฑ ์คํ์ด์ค ์ข์ฐ์ฌ๋ฐฑ(์คํ ๋ ๊ฐ์ ๊ฐ? ์ค) > ๊ฐ์ด๋ฐ ์ ๋ ฌ */ margin-top: 50px; padding-top: 50px; padding-bottom: 50px; /* ํฝ์ ์๊ฐ ๋์์ง๋ฉด ๋ ๋ฅ๊ธ์ด์ง */ border-radius: 10px; } table{ /* border: 1px solid black; border-collapse: collapse; /* ๊ฒน์น๋ ๋ถ๋ถ ์ด์ค์ ์์จ ์ ์์ */ width: 350px; margin: 0 auto; text-align: center; /* ๊ธ์ ์ ๋ ฌ */ } /* ๊ฐ์ ์์ฑ์ ์ค ๋๋ ,๋ก ๋์์ ํ๊ทธ์ ํ์ ์ ํ ๊ฐ๋ฅ */ tr, td{ /* border: 1px solid black; */ } </style> </head> <body> <div class="container"> <table> <colgroup> <!-- ํ ์ด๋ธ์ ์ด์ ํฌ๊ธฐ๋ ์์์ ์ง์ ํ๊ธฐ ๋๋ฌธ์ %๋ก ์ง์ ๊ฐ๋ฅ --> <col width="30%"> <!-- col ๋ซ๋ ํ๊ทธ ์์ ์ฒซ๋ฒ์งธ ์ด--> <col width="70%"> <!-- ๋๋ฒ์งธ ์ด --> </colgroup> <tr> <td>I D</td> <td> <input type="text" placeholder="Input your ID"> </td> </tr> <tr> <td>P W</td> <td> <input type="text" placeholder="Input your PASSWORD"> </td> </tr> <tr> <td colspan="2"> <a href="board_1.html">LOGIN</a> <a href="join.html">JOIN</a> </td> </tr> </table> </div> </body> </html> |
๋ก๊ทธ์ธ ๋๋ฅด๋ฉด ๊ฒ์ํ์ผ๋ก ์ด๋
์กฐ์ธ ๋๋ฅด๋ฉด ํ์๊ฐ์
์ฐฝ์ผ๋ก ์ด๋
<!DOCTYPE html>
<html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <style type="text/css"> .container{ width:700px; margin: 0 auto; margin-top: 70px; } table{ /* border: 1px solid balck; */ border-collapse: collapse; width: 700px; /* ํ ์ด๋ธ์ ๋๋น๋ง ์ฃผ๋ฉด ์ํ๊ฒ์ํ๊ณผ ์ ๋ง๊ธฐ ๋๋ฌธ์ ์ปจํ ์ด๋ ํฌ๊ธฐ์ ๊ฐ๊ฒ */ } thead > tr{ font-weight: bold; text-align: center; height: 30px; background-color: #FFFBF5; } thead > tr > td{ border-top: 3px solid #f3f3f3; border-bottom: 2px solid #f0f0f0; } tbody > tr{ text-align: center; height: 24px; } tbody > tr:nth-child(even){ background-color: #f1f1f1 } tbody > tr > td:nth-child(2) { text-align: left; color: blue; } tbody > tr > td{ /* ๋ด์ฉ tr์ ๋ง์ฐ์ค ์ฌ๋ฆฌ๋ฉด ๋์์ธ ์ ์ฉ */ border-bottom: 2px solid #f0f0f0; } tbody > tr:hover { background-color: #dddddd; } </style> </head> <body> <div class ="container"> <div> <h1>์ํ ๊ฒ์ํ</h1> </div> <div> <table> <colgroup> <col width="10%"> <col width="*"> <!-- *์ฐ์ผ๋ฉด ๋๋จธ์ง ํผ์ผํธ ๋ง์ถฐ์ค --> <col width="10%"> <col width="15%"> <col width="10%"> <col width="10%"> </colgroup> <thead> <tr> <td>๋ฒํธ</td> <td>์ ๋ชฉ</td> <td>์์ฑ์</td> <td>๋ ์ง</td> <td>์กฐํ์</td> <td>๋๊ธ์</td> </tr> </thead> <tbody> <tr> <td>165</td> <td>์ ๋ฌธ์ </td> <td>admin</td> <td>2013.06.21</td> <td>2</td> <td>0</td> </tr> <tr> <td>165</td> <td>์น์ฌ์ดํธ</td> <td>admin</td> <td>2013.06.21</td> <td>2</td> <td>0</td> </tr> <tr> <td>165</td> <td>์๋ ํ์ธ์</td> <td>admin</td> <td>2013.06.21</td> <td>2</td> <td>0</td> </tr> <tr> <td>165</td> <td>์๋ํ๋ ์ค</td> <td>admin</td> <td>2013.06.21</td> <td>2</td> <td>0</td> </tr> <tr> <td>165</td> <td>์ ์คํฐ์ปค ์ํ์ด ์ถ์๋์๋ค์~</td> <td>admin</td> <td>2013.06.21</td> <td>2</td> <td>0</td> </tr> </tbody> </table> </div> </div> <!-- aํ๊ทธ๋ ํ๊ทธ๋ ๊ฐ์ ์ ์๋ค. ๊ธ์๋ง ๋ค์ด๊ฐ๋ ๊ฒ ์๋! ๊ทธ๋ฌ๋ aํ๊ทธ ์ ์ --> <!-- <a href="test1_1.html"><input type="button" value="๋ค๋ก๊ฐ๊ธฐ"></a> --> <input type="button" value="๋ค๋ก๊ฐ๊ธฐ" onclick="location.href='test1_1.html';"> <input type="button" value="๋ค๋ก๊ฐ๊ธฐ" onclick="alert(5);"> <!-- ๋ฒํผ ํด๋ฆญํ๋ฉด ๋ญํ ์ง ์จํด๋ฆญ์ ๋ฃ์ด์ค --> </body> </html> |
๊ฒ์ํ
์ฒซ๋ฒ์งธ ๋ค๋ก๊ฐ๊ธฐ > ๋ก๊ทธ์ธ์ฐฝ์ผ๋ก ๋์๊ฐ
๋๋ฒ์งธ ๋ค๋ก๊ฐ๊ธฐ > ๋ฉ์ธ์ง ๋จ๊ฒ ํ๋ ๊ฒ
ํ์๊ฐ์
<!DOCTYPE html>
<html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <style type="text/css"> table{ border: 2px solid black; border-collapse: collapse; margin: 0 auto; } tr, td{ border: 2px solid black; } td:nth-child(1) { font-weight: bold; text-align: center; } tr:nth-child(7){ background-color: #cee3f6; } tr:nth-child(1){ background-color: #cee3f6; } .redFont{ color: red; text-align: right; font-style: italic; } span{ color: red; font-size: 14px; } textarea { resize: none; } </style> </head> <body> <div> <table> <tr> <td colspan="2"> <span class="redFont">*(ํ์์ ๋ ฅ)</span> ํ์๊ธฐ๋ณธ์ ๋ณด </td> </tr> <tr> <td><span>*</span>์์ด๋:</td> <td> <input type="text" placeholder="4~12์ ์๋ฌธ ๋์๋ฌธ์,์ซ์๋ง ์ ๋ ฅ"> <input type="button" value="์์ด๋ ๊ฒ์ฌ"> </td> </tr> <tr> <td><span>*</span>๋น๋ฐ๋ฒํธ:</td> <td><input type="password"> 4~12์์ ์๋ฌธ ๋์๋ฌธ์์ ์ซ์๋ก๋ง ์ ๋ ฅ</td> <tr> <td><span>*</span>๋น๋ฐ๋ฒํธํ์ธ:</td> <td> <input type="password"> <input type="button" value="๋น๋ฐ๋ฒํธ ํ์ธ"> </td> </tr> <tr> <td><span>*</span>๋ฉ์ผ์ฃผ์:</td> <td> <input type="text"> <input type="button" value="๋ฉ์ผ ํ์ธ"> ์) id@domain.com </td> </tr> <tr> <td><span>*</span>์ด๋ฆ:</td> <td><input type="text"></td> </tr> <tr> <td colspan="2">๊ฐ์ธ ์ ์ ์ ๋ณด</td> </tr> <tr> <td><span>*</span>์ฃผ๋ฏผ๋ฑ๋ก๋ฒํธ:</td> <td> <input type="text">-<input type="text"> <input type="button" value="ํ์ธ"> ์) 123456-1234567 </td> </tr> <tr> <td>์์ผ:</td> <td> <input type="text">๋ <input type="text">์ <input type="text">์ผ </td> </tr> <tr> <td>์ฃผ์:</td> <td> <input type="text"> <input type="button" value="์ฐํธ๋ฒํธ์ฐพ๊ธฐ"><br> <input type="text"> <input type="text"> </td> </tr> <tr> <td>๊ด์ฌ๋ถ์ผ:</td> <td> <input type= "checkbox">์ปดํจํฐ <input type= "checkbox">์ธํฐ๋ท <input type= "checkbox">์ฌํ <input type= "checkbox">์ํ๊ฐ์ <input type= "checkbox">์์ ๊ฐ์ </td> </tr> <tr> <td>์๊ธฐ์๊ฐ:</td> <td> <textarea rows="5" cols="60"></textarea> </td> </tr> </table> </div> <a href="test1_1.html">๋ค๋ก๊ฐ๊ธฐ</a> </body> </html> |
๋ค๋ก๊ฐ๊ธฐ ๋๋ฅด๋ฉด ๋ก๊ทธ์ธ์ฐฝ์ผ๋ก ์ด๋
'CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Scroll bar (0) | 2023.04.27 |
---|---|
div ํ๊ทธ ๊ฐ๋ก ๋ฐฐ์น (0) | 2023.03.07 |
ํฐํธ ๋ณ๊ฒฝ (0) | 2023.02.23 |
CSS๊ธฐ์ด2 (0) | 2023.02.09 |
CSS ๊ธฐ์ด (0) | 2023.02.08 |