HTML+CSS登录界面

效果图


在这里插入图片描述

代码块
html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登入</title>
    <link rel="icon" href="background/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="css/index.css">
</head>
<body>
<img class="background" src="background/blog.jpg">
<div class="overall" id="overall">
    <div class="form">
        <div class="log">
            <p class="p1">登入</p>
        </div>

        <div class="logo">
            <img src="background/1.png" width="20px" height="20px" alt=""/>
            <input type="text" id="username" placeholder="输入用户名"/><br><br>
            <input type="password" id="password" placeholder="输入用户密码"/>
        </div>

        <div class="image">
            <img src="background/2.png" width="20px" height="20px" alt=""/>
        </div>

        <div class="login">
                <input type="button" id="dengbutton" value="登入" onclick="login()">
            <!--<input type="checkbox" id="rememberMe" checked="checked"/>记住密码-->
        </div>
    </div>
</div>
</body>
</html>

css

*{
    margin: 0;
    padding: 0;
}

/* 整体框架样式和位置布局*/
#overall{
    width: 1200px;
    background-repeat: no-repeat;
    background-position: center center;
}

/* 表格表头布局 */
.form .log .p1{
    display: inline-block;
    font-size: 28px;
    margin-top: 30px;
    width: 86%;
}

#overall .form .log{
    width: 86%;
    border-bottom: 1px solid #ee7700;
    margin-bottom: 60px;
    margin-top: 0px;
    margin-right: auto;
    margin-left: auto;
}

/* 表格位置和样式 */
#overall .form{
    height: 408px;
    width: 368px;
    position: absolute;
    background-color: #FFFFFF;
    top: 20%;
    right: 15%;
}

/* 用户名文本框前面的图片布局 */
.form .logo img{
    position: absolute;
    top: 12px;
    left: 8px;
}

/* 密码文本框前面的图片布局 */
.form .image img{
    position: absolute;
    top: 209px;
    left: 35px;
}

/* 用户名和密码文本框布局 */
.form .logo input{
    width: 95%;
    height: 42px;
    text-indent: 2.5rem;
}

#overall .form .logo{
    width: 86%;
    position: relative;
    margin-bottom: 30px;
    margin-top: 30px;
    margin-right: auto;
    margin-left: auto;
}

/* 登入按钮布局 */
.login input{
    width: 100%;
    height: 45px;
    background-color: #ee7700;
    border: none;
    color: white;
    font-size: 18px;
}

/* 登入文本框布局 */
#overall .form .login{
    width: 86%;
    margin-top: 15px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
}


#overall .form .login #rememberMe{
    margin-top: 10px;
    width: 10px;
    height: 10px;
}

.background{
    width: 100%;
    height: 932px;
}
  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值