CSS练习小题(九):静态登录页

效果:

 代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            outline: none;
            box-sizing: border-box;
            text-decoration: none;
        }
        .mb20{
            margin-bottom: 20px;
        }
        .login_wrap{
           margin: 50px auto;
           padding: 10px 20px;
           width: 400px;
           background-color: #faebd7; 
        }
        .login_wrap .title{
            font-size: 20px;
            line-height: 60px;
        }
        .form_item{
            position: relative;
            width: 100%;
            height: 32px;
        }
        .form_item span{
            position: absolute;
            top: 3px;
            left: 3px;
            width: 13px;
            height: 13px;
        }
        .form_item input{
            padding: 0 30px;
            width: 100%;
            height: inherit;
            border: none;
        }
        #submit_btn{
            cursor: pointer;
            border: none;
            color: #ffffff;
            background-color: #1e90ff;
        }
        .more{
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .more a{
            font-size: 12px;
            color: #0000ff;
        }
    </style>
</head>
<body>
    <div class="login_wrap">
        <div class="title">用户登录</div>
        <!-- <hr/> -->
        <form id="form" action="">
            <div class="form_item mb20">
                <span>👤</span>
                <input type="text" value="" id="username" placeholder="请输入用户名"/>
            </div>
            <div class="form_item mb20">
                <span>🔐</span>
                <input type="password" value="" id="password" placeholder="请输入密码"/>
            </div>
            <div>
                <button id="submit_btn" class="form_item" type="button">提交</button>
            </div>
            <div class="form_item more">
                <a href="">注册账户</a>
                <a href="">忘记密码</a>
            </div>
        </form>

    </div>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值