HTML & CSS - 一个简单的登录页面 2

一个简单的登录页面

效果:

在这里插入图片描述

在这里插入图片描述

项目结构:

在这里插入图片描述

HTML 代码:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>登录 2</title>
        <link rel="stylesheet" href="css/style.css">
    </head>`
    <body>
        <!-- 参考:https://www.bilibili.com/video/BV1s94y1S7f2?spm_id_from=333.337.search-card.all.click&vd_source=3bc1dd4a42012fa273cf171a6833d07b -->
        <div class="container">
            <h2>Login</h2>
            <div class="input-container">
                <label for="account">账号</label>
                <input type="text" id="account">
            </div>
            <div class="input-container">
                <label for="password">密码</label>
                <input type="password" id="password" value="123">
            </div>
            <div class="button-container">
                <a href="#">忘记密码?</a>
                <div>
                    <button class="login">登录</button>
                </div>
            </div>
        </div>
    </body>
</html>

CSS 代码:

@charset "utf-8";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* border: 2px solid red; */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: url("../img/fox.jpg") no-repeat;
    background-size: cover;
}

div.container {
    border: 1px solid rgba(255, 255, 255, 0);
    border-radius: 10px;
    /* height: 360px; */
    width: 400px;
    backdrop-filter: blur(0px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    transition: 1s;
}

div.container:hover {
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

div.container > h2 {
    /* border: 1px solid black; */
    width: 100%;
    height: 50px;
    line-height: 50px;
    font-size: 50px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    user-select: none;
}

div.container > div.input-container {
    /* border: 1px solid black; */
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
    /* height: 100px; */
}

div.container > div.input-container > label {
    color: rgba(255, 255, 255, 0.6);
    user-select: none;
    cursor: pointer;
    transition: 0.6s;
    /* margin-bottom: 5px; */
    /* border: 1px solid red; */
    width: 100%;
    font-size: 15px;
    height: 35px;
    line-height: 35px;
    letter-spacing: 1px;
}

div.container > div.input-container > label:hover {
    color: rgba(255, 255, 255, 1);
}

div.container > div.input-container > input {
    background-color: rgba(62, 97, 143, 0);
    color: rgba(255, 255, 255, 1);
    outline: none;
    padding: 10px;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 5px;
    font-size: 15px;
    transition: 0.6s;
    width: 100%;
}

div.container > div.input-container > input:hover {
    background-color: rgba(62, 97, 143, 0.4);
    border: 1px solid rgba(255, 255, 255, 1);
}

div.container > div.input-container > input:focus {
    background-color: rgba(62, 97, 143, 0.4);
    border: 1px solid rgba(255, 255, 255, 1);
}

div.container > div.button-container {
    /* border: 1px solid black; */
    width: 100%;
    display: flex;
    flex-direction: column;
    
}

div.container > div.button-container > a {
    /* border: 1px solid red; */
    text-decoration: none;
    /* width: 100%; */
    height: 35px;
    text-align: end;
    line-height: 35px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    transition: 0.6s;
    letter-spacing: 1px;
}

div.container > div.button-container > a:hover {
    color: rgba(255, 255, 255, 1);
}

div.container > div.button-container > div {
    /* border: 1px solid red; */
}

div.container > div.button-container > div > button.login {
    height: 35px;
    width: 100%;
    background: rgba(83, 116, 167, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 5px;
    transition: 1s;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    font-size: 15px;
    user-select: none;
    cursor: pointer;
}

div.container > div.button-container > div > button.login:hover {
    background: rgba(83, 116, 167, 0.2);
    border: 1px solid rgba(255, 255, 255, 1);
    color: rgba(255, 255, 255, 1);
}

参考

HTML & CSS - 一个简单的登录页面

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值