HTML - CSS/기초정리

HTML 기초 - 회원가입 폼 만들기 실습

줘니(•̀ᴗ•́)و 2023. 1. 5. 14:04
728x90

 

table태그로 큰 틀을 짜서 실습을 했다!

 

 

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form method="get" action="#">
        <table width="400px">
            <!-- step 1 : 아이디/비번 입력 -->
            <!-- (tr>td*2)*4 식을 활용하면 한번에 윤곽이 잡힘 -->
            <tr bgcolor="gray" height="50px">
                <th colspan="2">Step1 : 아이디/비번 입력</th>
            </tr>
            <tr height="35px" bgcolor="whitesmoke">
                <td>아이디</td>
                <td>
                    <input type="text">
                </td>
            </tr>
            <tr height="35px" bgcolor="whitesmoke">
                <td>비밀번호</td>
                <td>
                    <input type="password">
                </td>
            </tr>
            <tr height="35px" bgcolor="whitesmoke">
                <td>비밀번호 확인</td>
                <td>
                    <input type="password">
                </td>
            </tr>

            <!-- step 2 : 개인정보 -->
            <tr bgcolor="gray" height="50px">
                <th colspan="2">Step2 : 개인정보</th>
            </tr>
            <tr height="35px" bgcolor="whitesmoke">
                <td>성별</td>
                <td>
                    남 <input type="radio" name="gender" value="man">
                    여 <input type="radio" name="gender" value="woman">
                </td>
            </tr>
            <tr height="35px" bgcolor="whitesmoke">
                <td>혈액형</td>
                <td>
                    <select>
                        <option>A형</option>
                        <option>B형</option>
                        <option>O형</option>
                        <option>AB형</option>
                    </select>
                </td>
            </tr>
            <tr height="35px" bgcolor="whitesmoke">
                <td>생일</td>
                <td>
                    <input type="date">
                </td>
            </tr>

            <!-- step 3 : 선호도 -->
            <tr bgcolor="gray" height="50px">
                <th colspan="2">Step 3 : 선호도</th>
            </tr>
            <tr height="35px" bgcolor="whitesmoke">
                <td>취미</td>
                <td>
                    축구 <input type="checkbox" name="hobby" value="sc">
                    야구 <input type="checkbox" name="hobby" value="bs">
                    농구 <input type="checkbox" name="hobby" value="bk">
                </td>
            </tr>
            <tr height="35px" bgcolor="whitesmoke">
                <td>좋아하는 색깔</td>
                <td>
                    <input type="color">
                </td>
            </tr>

            <!-- step 4 : 하고싶은 말 -->
            <tr bgcolor="gray" height="50px">
                <th colspan="2">Step 4 : 하고싶은 말</th>
            </tr>
            <tr height="35px" bgcolor="whitesmoke">
                <td colspan="2">
                    <textarea cols="56" rows="5"></textarea>
                </td>
            </tr>
            
            <!-- 제출 & 초기화 -->
            <tr height="35px" bgcolor="whitesmoke">
                <td align="center" colspan="2">
                    <input type="submit">
                    <input type="reset">
                </td>
            </tr>
        </table>
    </form>
</body>

</html>

 

실습으로 하나하나 디자인을 했지만

이제 CSS를 배우면 이 코드보다 짧고, 간단하고, 더 감각있게 디자인을 할 수 있다는 것!

 

728x90