利用html&css制作简单登录页面

参考网上别人做出来的实例:
在这里插入图片描述
做出来的效果:
在这里插入图片描述

下面是html代码:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>
            ziupan
        </title>
        <link rel="stylesheet" href="首页.css">
    </head>
    <body>
        <div id="main">
            <div id="avater">

            </div>
            <div id="account">
                <div class="input-box"><input type="text" placeholder="用户名"></div>
                <div class="input-box"><input type="password" placeholder="密码"></div>
                <div class="forget_a"><a href="#" >忘记密码?</a></div>
            </div>

            <button class="login-btn">登录</button>


            <div id="footer">
                <a href="#">还不是会员?</a>
                <a style="color: #015b7e">立即注册</a>
            </div>
        </div>
    </body>
</html>

css代码:

@charset "utf-8";
/*登陆区主体*/
#main{
    border: thin solid #ededed;
    width: 350px;
    height: 600px;
    background: #fff;
    margin: 40px auto;
    /*border-top: 8px solid #015b7e;;*/
    position: relative;
}
/*头像区*/
#avater{
    width: 185px;
    height: 185px;
    background: url("webp1.png") no-repeat;
    background-size: cover;
    margin: 50px auto;
    border: thin solid #ededed;
    border-radius: 50%;
}

/*账号密码区*/
#account{
    width: 75%;
    line-height: 50px;
    /*height: 200px;*/
    /*background: #ffd1e4;*/
    margin: 0 auto;
}
#account .input-box{
    height: 50px;
    border: 1.5px solid #cccccc;
    /*background: #ffbcdd;*/
}
#account .input-box input{
    height: 40px;
    width: calc(100% - 10px);
    border: none;
    outline: none;
    padding: 0 5px;
    /*background: rgba(0,0,0,0.5);*/
    color: #ffcae5;
    font-size: 16px;
    font-weight: bold;
}

/*登录按钮*/
.login-btn{
    width: 75%;
    height: 40px;
    display: block;
    margin: 30px auto;
    background:#015b7e ;
    border: none;
    outline: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}
/*按下按钮*/
.login-btn:active{
    position: relative;
    top:2px;
}

/*登陆区底部*/
#footer{
    background: #f5f5f5;
    height: 50px;
    text-align: center;
    line-height: 50px;
    position: absolute;
    bottom: 0;
    width: 100%;
    /*border-top: 1px solid #ccc;*/
}

.forget_a{
    text-align:right;
}

.forget_a>a{
    color:#cccccc;
}

#footer a{
    color: #cccccc;
    text-decoration: none;
}
#footer a:hover{
    color: red;
}

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值