html表单联系 注册表的实现

<!DOCTYPE html>
<html>
<head>
    <title>用户注册表单</title>
    <style>
        form {
            width: 400px;
            margin: 0 auto;
            font-family: Arial, sans-serif;
        }
        label {
            display: block;
            margin-bottom: 10px;
        }
        input[type="text"],
        input[type="password"],
        textarea,
        select {
            width: 200px;
            padding: 5px;
            margin-bottom: 10px;
        }
        input[type="checkbox"],
        input[type="radio"] {
            margin-right: 5px;
        }
        .checkbox-group {
            margin-bottom: 10px;
        }
        .flex-container {
            display: flex;
            flex-direction: column;
        }
        .flex-container label,
        .flex-container input,
        .flex-container select {
            margin-bottom: 10px;
        }
        .flex-container .checkbox-group {
            flex-direction: row;
            align-items: center;
        }
        input[type="submit"],
        input[type="reset"] {
            padding: 10px 20px;
            background-color: #4CAF50;
            color: #fff;
            border: none;
            margin-top: 10px;
            cursor: pointer;
        }
        input[type="submit"]:hover,
        input[type="reset"]:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>
    <form action="/submit" method="post" class="flex-container">
        <label for="UserName">用户名:</label>
        <input type="text" id="UserName" name="UserName" maxlength="20" pattern=".{15,}" required>
        <label for="UserPass">密码:</label>
        <input type="password" id="UserPass" name="UserPass" maxlength="20" pattern=".{15,}" required>
        <div class="checkbox-group">
            <label for="sex">性别:</label>
            <input type="radio" id="sex-male" name="sex" value="男" checked>
            <label for="sex-male">男</label>
            <input type="radio" id="sex-female" name="sex" value="女">
            <label for="sex-female">女</label>
        </div>
        <div class="checkbox-group">
            <label for="like">爱好:</label>
            <input type="checkbox" id="like-writing" name="like[]" value="写作">
            <label for="like-writing">写作</label>
            <input type="checkbox" id="like-music" name="like[]" value="听音乐">
            <label for="like-music">听音乐</label>
            <input type="checkbox" id="like-sports" name="like[]" value="体育">
            <label for="like-sports">体育</label>
        </div>
        <label for="province">省份:</label>
        <select id="province" name="province">
            <option value="shaanxi" selected>陕西省</option>
            <option value="shanx">山西省</option>
        </select>
        <label for="intro">自我介绍:</label>
        <textarea id="intro" name="intro" rows="5" cols="25">这个家伙什么也没留下</textarea>
        <input type="submit" id="send" value="提交">
        <input type="reset" id="reset" value="重置">
    </form>
</body>
</html>

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值