简约登录页

简介

一个简洁且现代的登录页面设计模板,适用于各类网站的登录功能。该页面使用了响应式布局,使其在不同设备上都能保持良好的用户体验。

效果说明
  • 页面布局居中,背景为渐变色。
  • 登录框内有两个输入框,分别用于输入用户名和密码。
  • 输入框使用浮动标签,聚焦时标签会上移以提示用户。
  • 登录按钮使用渐变颜色,带有悬停效果。
  • 提供了一个注册的链接,位于登录按钮下方。

html部分

<div class="login-container">
        <div class="login-box">
            <h2>Login</h2>
            <form>
                <div class="input-box">
                    <input type="text" required>
                    <label>Username</label>
                </div>
                <div class="input-box">
                    <input type="password" required>
                    <label>Password</label>
                </div>
                <button type="submit" class="btn">登录</button>
                <p class="register-link">没有账号?去注册 <a href="#">Register</a></p>
            </form>
        </div>
    </div>

css部分

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(120deg, #2980b9, #8e44ad);
}

.login-container {
    width: 400px;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.input-box {
    position: relative;
    margin-bottom: 30px;
}

.input-box input {
    width: 100%;
    padding: 10px;
    background: #f0f0f0;
    border: none;
    outline: none;
    border-radius: 5px;
    font-size: 16px;
    color: #333;
}

.input-box label {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    font-size: 16px;
    color: #777;
    pointer-events: none;
    transition: 0.3s;
}

.input-box input:focus + label,
.input-box input:valid + label {
    top: -10px;
    left: 10px;
    font-size: 12px;
    color: #2980b9;
}

.btn {
    width: 100%;
    padding: 10px;
    background: #2980b9;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.btn:hover {
    background: #8e44ad;
}

.register-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.register-link a {
    color: #2980b9;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

  • 5
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
HTML和CSS是前端开发中的两种基本技术,可以用来创建简约登录注册面。 登录面一般包括一个登录表单,其中包含用户名和密码的输入框,以及一个登录按钮。 注册面一般包括一个注册表单,其中包含用户名、密码和确认密码的输入框,以及一个注册按钮。 在HTML中,可以使用```<form>```标签创建表单,用```<input>```标签创建输入框,用```<button>```标签创建按钮。使用CSS可以设置表单和输入框的样式,例如设置宽度、边框样式、背景颜色等。 以下是一个使用HTML和CSS创建简约登录注册面的示例: ```html <!DOCTYPE html> <html> <head> <title>登录注册面</title> <style> form { width: 300px; margin: 0 auto; padding: 20px; background-color: #f5f5f5; } input[type="text"], input[type="password"] { width: 100%; padding: 10px; margin-bottom: 15px; border-radius: 5px; border: 1px solid #ccc; } button { width: 100%; padding: 10px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; } button:hover { background-color: #45a049; } </style> </head> <body> <form> <h2>登录</h2> <input type="text" placeholder="用户名"> <input type="password" placeholder="密码"> <button type="submit">登录</button> </form> <form> <h2>注册</h2> <input type="text" placeholder="用户名"> <input type="password" placeholder="密码"> <input type="password" placeholder="确认密码"> <button type="submit">注册</button> </form> </body> </html> ``` 以上示例中,使用了```<form>```标签创建了两个表单,使用了```<input>```标签创建输入框,使用了```<button>```标签创建登录和注册按钮。通过CSS的样式设置,达到了简约登录注册面效果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值