HTML表单小练习

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>制作表单</title>
    <style>
        form {width: 400px;height: 460px;padding: 20px;background-color: #f2f2f2;margin: 0px auto}
        h3 {border-bottom: 1px solid #808080;line-height: 50px;margin: 0px;}
        .na_pw {width: 236px;height: 18px;}
        .p_name {margin-right: 80px;}
        /* .gen {margin-right: 80px}
        .gen1 {margin-right: 80px;} */
        .text {width: 240px;height: 100px;}
        .pp {float: left;}
        .sub {margin-left: 80px;}
        .lab_ {width: 80px;float: left;text-align: right;}
    </style>
</head>
<body>
    <form action="http://www.baidu.com" method="POST">
        <h3>注册表单</h3>
        <p class="p_name">
            <label for="1" class="lab_">姓名:</label>
            <input type="text" name="username" id="1" class="na_pw">
        </p>
        <p>
            <label for="2" class="lab_">密码:</label>
            <input type="password" name="pawd" id="2" class="na_pw">
        </p>
        <p>
            <label for="3" class="lab_">性别:</label>
            <input type="radio" name="gender" id="3" class="gen">男
            <input type="radio" name="gender" id="3" class="gen1">女
        </p>
        <p>
            <label for="4" class="lab_">爱好:</label>
            <input type="checkbox" name="hobby" id="4">唱歌
            <input type="checkbox" name="hobby" id="4">跑步
            <input type="checkbox" name="hobby" id="4">游泳
        </p>
        <p>
            <label for="5" class="lab_">照片:</label>
            <input type="file" name="photo" id="5">
        </p>
        <p>
            <label for="6" class="pp" class="lab_">个人描述:</label>
            <textarea name="描述" id="6" cols="30" rows="10" class="text"></textarea>
        </p>
        <p>
            <label for="7" class="lab_">籍贯:</label>
            <select name="籍贯" id="7">
                <option value="1">北京</option>
                <option value="2">上海</option>
                <option value="3">深圳</option>
                <option value="4">杭州</option>
            </select>
        </p>
        <p>
            <input type="submit" name="submit" id="8" class="sub">
            <input type="reset">
        </p>

    
    
    
    </form>
    
</body>
</html>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值