用户注册代码

这是一个HTML5用户注册页面的示例,包含了CSS样式设计,包括注册面板、水平线、输入表单和按钮的样式定义。页面背景设为浅灰色,注册面板使用白色背景,具有阴影效果。输入字段包括用户名、密码、确认密码、姓名和邮箱,所有字段均为必填。提交按钮在鼠标悬停时颜色会变化。

body {
    background-color:#CCCCCC;/*设置页面背景色为浅灰色*/
}

/*注册面板样式*/
#container{
    background-color:white;
    color:#2289F0;
    padding:15px;
    margin: 100px auto 0px; /*上边距100px;左右为auto;下边距0px*/
    width:600px;
    text-align:center;
    font-family:"微软雅黑 Light";
    box-shadow: 10px 10px 15px black;
}

/*水平线样式*/
hr{
    width:80%;
    border:#2289F0 1px solid;
    margin-bottom:15px;
}

/*输入表单样式*/
input{
    width:180px;
    height:20px;
    margin:5px;
    font-size:16px;
    font-family:"微软雅黑 Light";
}

/*按钮样式*/
button{
    width:120px;
    height:40px;
    background-color:#2289F0;
    border:0px;
    color: white;
    margin:10px;
    font-size:18px;
    font-family:"微软雅黑 Light";
    font-weight:bold;
}

/*鼠标悬浮时按钮样式*/
button:hover{
    background-color:#0068D0;
}

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" >
        <title>HTML5用户注册页面示例</title>
        <link rel="stylesheet" href="css/reg.css">
    </head>
    <body>
        <div id="container">
            <!--页面标题-->
            <h1>用户注册页面</h1>
            <!--水平线-->
            <hr />
            <!--表单-->
            <form method="post" action="URL" autocomplete="on">
                <label>用户名:
                    <input type="text" placeholder="请输入用户名" name="username" required />
                </label>
                <br />
                <label>密 码:
                    <input type="password" placeholder="请输入密码" name="pwd" required />
                </label>
                <br />
                <label>确 认:
                    <input type="password" placeholder="请再次输入密码" name="pwd" required />
                </label>
                <br />
                <label>姓 名:
                    <input type="text" placeholder="请输入真实姓名" name="name" required />
                </label>
                <br />
                <label>邮 箱:
                    <input type="email" placeholder="请输入电子邮箱" name="email" required />
                </label>
                <br />
                <button type="submit">
                    提交注册
                </button>
            </form>
        </div>
    </body>
</html>

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值