分享好友 资讯首页 资讯分类 切换频道

web注册页面代码

2025-11-10 12:5000

这是一个基本的Web注册页面的HTML和CSS代码示例。请注意,这只是一个基本的示例,实际的注册页面可能需要更复杂的前端和后端逻辑来处理用户输入和验证。此外,出于安全原因,密码应该通过HTTPS进行传输,并且应该在服务器端进行哈希处理。

web注册页面代码

HTML代码:

<!DOCTYPE html>
<html>
<head>
    <title>注册页面</title>
    <link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
    <div class="register-container">
        <h2>注册</h2>
        <form action="/register" method="post">
            <div class="input-group">
                <label for="username">用户名:</label>
                <input type="text" id="username" name="username" required>
            </div>
            <div class="input-group">
                <label for="email">电子邮件:</label>
                <input type="email" id="email" name="email" required>
            </div>
            <div class="input-group">
                <label for="password">密码:</label>
                <input type="password" id="password" name="password" required>
            </div>
            <div class="input-group">
                <label for="confirm_password">确认密码:</label>
                <input type="password" id="confirm_password" name="confirm_password" required>
            </div>
            <button type="submit">注册</button>
        </form>
    </div>
</body>
</html>

对应的CSS代码(styles.css):

body {
    font-family: Arial, sans-serif;
}
.register-container {
    width: 300px;
    padding: 16px;
    background-color: white;
    margin: 0 auto; 
    margin-top: 100px; 
    border-radius: 4px; 
}
h2 {
    text-align: center; 
}
.input-group {
    margin-bottom: 10px; 
}
label { 
    display: block; 
    margin-bottom: 5px; 
}
input[type=text], input[type=email], input[type=password] { 
    width: 100%; 
举报
收藏 0
打赏 0
评论 0
 
友情链接