TIME2026-03-17 07:35:59

gett 接码网[U84]

搜索
热点
新闻分类
友情链接
首页 > 资讯 > 注册页面代码html+css
资讯
注册页面代码html+css
2025-12-23IP属地 美国0

这是一个基本的注册页面的HTML和CSS代码示例。请注意,这只是一个基本的示例,您可能需要根据您的实际需求进行修改和扩展。此外,为了安全起见,您应该使用后端语言(如PHP、Node.js等)来处理表单数据,并确保对用户输入进行适当的验证和清理。

注册页面代码html+css

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="form-group">
                <label for="username">用户名:</label>
                <input type="text" id="username" name="username" required>
            </div>
            <div class="form-group">
                <label for="email">电子邮件:</label>
                <input type="email" id="email" name="email" required>
            </div>
            <div class="form-group">
                <label for="password">密码:</label>
                <input type="password" id="password" name="password" required>
            </div>
            <div class="form-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):

注册页面代码html+css

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}
.register-container {
    width: 300px;
    padding: 16px;
    background-color: white;
    margin: 0 auto; 
    margin-top: 100px; 
    border-radius: 4px; 
    box-shadow: 0px 0px 10px 0px rgba(8, 8, 8, 0.3); 
}
h2 {
    text-align: center; 
}
.form-group {
    margin-bottom: 15px; 
}
input[type=text], input[type=email], input[type=password] { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ccc; 
    border-radius: 4px;                                  } input::-webkit-input-placeholder { color: #ccc; } input::-moz-placeholder { color: #ccc; } input:-ms-input-placeholder { color: #ccc; } input[type=submit] { width: 100%; padding: 14px; background-color: #4CAF50; border: none; border-radius: 4px; color: white; cursor: pointer; } input[type=submit]:hover { background-color: #45a049; } label { display: block; margin-bottom: 5px; } form { display: flex; flex-direction: column; } form div { margin-bottom: 1em; } form button { margin-top: 1em; } form button, input[type=submit] { align-self: center; } form button, input[type=submit