Day_2 #3

Open
opened 2026-09-11 18:22:45 +08:00 by pjc · 10 comments
Owner
No description provided.
  • 表单能显示并填写
  • radio 能单选
  • 用了 input / select / button
<!doctype html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <title>报名表单</title>
  </head>
  <body>
    <h1>报名表</h1>

    <form>
      <p>
        <label for="username">姓名:</label>
        <input type="text" id="username" name="username" />
      </p>

      <p>
        <label for="password">密码:</label>
        <input type="password" id="password" name="password" />
      </p>

      <p>
        性别:
        <label> <input type="radio" name="gender" value="male" /> 男 </label>
        <label> <input type="radio" name="gender" value="female" /> 女 </label>
      </p>

      <p>
        <label for="direction">意向方向:</label>
        <select id="direction" name="direction">
          <option value="frontend">前端</option>
          <option value="backend">后端</option>
        </select>
      </p>

      <button type="submit">提交报名</button>
    </form>
  </body>
</html>
- [x] 表单能显示并填写 - [x] radio 能单选 - [x] 用了 input / select / button ```html <!doctype html> <html lang="zh"> <head> <meta charset="UTF-8" /> <title>报名表单</title> </head> <body> <h1>报名表</h1> <form> <p> <label for="username">姓名:</label> <input type="text" id="username" name="username" /> </p> <p> <label for="password">密码:</label> <input type="password" id="password" name="password" /> </p> <p> 性别: <label> <input type="radio" name="gender" value="male" /> 男 </label> <label> <input type="radio" name="gender" value="female" /> 女 </label> </p> <p> <label for="direction">意向方向:</label> <select id="direction" name="direction"> <option value="frontend">前端</option> <option value="backend">后端</option> </select> </p> <button type="submit">提交报名</button> </form> </body> </html> ```

表单能显示并填写
radio 能单选
用了 input / select / button
(就是有点错位。。。)

<html lang="zh"> <head> </head>

性别: 男 女

方向: 前端 后端

提交 </html>
表单能显示并填写 radio 能单选 用了 input / select / button (就是有点错位。。。) <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>报名表</title> </head> <body> <form> <p><label for="name">Name:</label></P> <input type="text" id="name" name="user_name" /> <label for="name">password:</label></P> <input type="password" id="word" name="user_password" /></P> <p>性别: <label><input type="radio" name="gender" value="男">男</label> <label><input type="radio" name="gender" value="女">女</label> </p> <p>方向: <select name="direction"> <option value="frontend">前端</option> <option value="backend">后端</option> </select> </p> <button type="submit">提交</button> </form> </body> </html>
屏幕截图 2026-09-14 133656.png
<img width="544" alt="屏幕截图 2026-09-14 133656.png" src="attachments/ea1b8994-b19f-4074-a284-e61d77ec7bab">

完成

<!DOCTYPE html>
<html lang="zh">
    <head>
        <meta charset="UTF-8">
        <title>报名</title>
    </head>
    <body>
        <h1>
            报名表
        </h1>
        <div>
            <form>
                <label>名字:
                    <input type="text" name="name" id="name" placeholder="name here">
                    </input>
                </label>
                <br>
                <label>
                    密码:
                    <input type="password" name="password" placeholder="passwd here">
                </label>
                <br>
                    性别:
                    <div style="display: inline-block;vertical-align: top;">
                         男<input type="radio" name="sex" value="male">
                         <br>
                        女<input type="radio" name="sex" value="female">
                
                    </div>
                <br>
                    方向:
                    <select name="willing">
                        <option value="frontend">前端</option>
                        <option value="backend">后端</option>
                    </select>
                <br>
                <button type="submit">提交</button>
            </form>
        </div>
    </body>
</html>
完成 ``` <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>报名</title> </head> <body> <h1> 报名表 </h1> <div> <form> <label>名字: <input type="text" name="name" id="name" placeholder="name here"> </input> </label> <br> <label> 密码: <input type="password" name="password" placeholder="passwd here"> </label> <br> 性别: <div style="display: inline-block;vertical-align: top;"> 男<input type="radio" name="sex" value="male"> <br> 女<input type="radio" name="sex" value="female"> </div> <br> 方向: <select name="willing"> <option value="frontend">前端</option> <option value="backend">后端</option> </select> <br> <button type="submit">提交</button> </form> </div> </body> </html> ```

表单能显示并填写
radio 能单选
用了 input / select / button

表单能显示并填写 radio 能单选 用了 input / select / button
<html lang="zh"> <head> </head>

姓名:

密码:

性别: 男 女

方向: 前端 后端

提交 </html> ![image.png](/attachments/65b075dc-7a4b-4f3d-80b5-05f47e6f1eac)![image.png](/attachments/8bb10e65-8589-409a-a03a-28b83cd7d2ba)
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>报名表单</title> </head> <body> <form> <p> <!--文本--> 姓名: <input type="text" name="name"> </p> <p> <!--密码--> 密码: <input type="password" name="password"> </p> <p> 性别: <!--单选--> <!--<label></label>可以扩大范围--> <input type="radio" name="gender" value="男">男 <label><input type="radio" name="gender" value="女">女</label> </p> <p> 方向: <!--下拉框--> <select name="direction"> <option value="front">前端</option> <option value="backend">后端</option> </select> </p> <!--按钮--> <button type="submit">提交</button> </form> </body> </html> ![image.png](/attachments/65b075dc-7a4b-4f3d-80b5-05f47e6f1eac)![image.png](/attachments/8bb10e65-8589-409a-a03a-28b83cd7d2ba)
<html lang="en"> <head> </head> 姓名:
密码:
性别:男 女
意向方向: 前端 后端 </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>报名表单</title> </head> <body> <form >姓名:<input type="text" name="name"><br> 密码:<input type="password" name="password"><br> 性别:<label><input type="radio" name="gender" value="male">男</label> <label><input type="radio" name="gender" value="female">女</label><br> 意向方向:<select name="direction"> <option value="frontend">前端</option> <option value="backend">后端</option> </select> </form> </body> </html>

已全部完成

已全部完成
<br>

<!-- 密码输入框 -->
<label for="password">密码:</label>
<input type="password" id="password" name="password" required>

<br>

<!-- 单选按钮 -->
<label>性别:</label>
<input type="radio" id="male" name="gender" value="male" checked>
<label for="male">男</label>
<input type="radio" id="female" name="gender" value="female">
<label for="female">女</label>

<br>

<!-- 复选框 -->
<input type="checkbox" id="subscribe" name="subscribe" checked>
<label for="subscribe">订阅推送信息</label>

<br>

<!-- 下拉列表 -->
<label for="country">国家:</label>
<select id="country" name="country">
    <option value="cn">CN</option>
    <option value="usa">USA</option>
    <option value="uk">UK</option>
</select>

<br>

<!-- 提交按钮 -->
<input type="submit" value="提交">
<form action="/" method="post"> <!-- 文本输入框 --> <label for="name">用户名:</label> <input type="text" id="name" name="name" required> <br> <!-- 密码输入框 --> <label for="password">密码:</label> <input type="password" id="password" name="password" required> <br> <!-- 单选按钮 --> <label>性别:</label> <input type="radio" id="male" name="gender" value="male" checked> <label for="male">男</label> <input type="radio" id="female" name="gender" value="female"> <label for="female">女</label> <br> <!-- 复选框 --> <input type="checkbox" id="subscribe" name="subscribe" checked> <label for="subscribe">订阅推送信息</label> <br> <!-- 下拉列表 --> <label for="country">国家:</label> <select id="country" name="country"> <option value="cn">CN</option> <option value="usa">USA</option> <option value="uk">UK</option> </select> <br> <!-- 提交按钮 --> <input type="submit" value="提交"> </form>

表单能显示并填写
radio 能单选
用了 input / select / button

表单能显示并填写 radio 能单选 用了 input / select / button
Sign in to join this conversation.