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;
}
登录界面HTMLCSS可以通过以下代码实现: HTML代码: ``` <!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>Login</title> <link rel="stylesheet" href="style.css"/> </head> <body> <div class="box"> <h2>Login</h2> <div class="input-box"> <label>账号</label> <input type="text"> </div> <div class="input-box"> <label>密码</label> <input type="password"> </div> <div class="btn-box"> <a href="#">忘记密码</a> <div> <button>登录</button> <button>注册</button> </div> </div> </div> </body> </html> ``` CSS代码: ``` img { width: 150px; height: 150px; } #login-img { margin-left: 30px; float: left; } #register-img { float: right; margin-right: 35px; } #img-control { margin-top: 65px; } #form-border { background-color: rgba(188, 176, 212, 0.6); width: 500px; height: 300px; position: absolute; margin: auto; top: 0; bottom: 0; left: 0; right: 0; } .form-input { width: 200px; height: 25px; padding-left: 5px; border-radius: 5px; } .form-label { margin-left: 30px; } .form-button { width: 70px; height: 30px; margin-top: 10px; margin-left: 70px; font-size: 18px; font-family: "宋体"; } #div-title { text-align: center; margin-top: 150px; } h3 { font-size: 40px; font-family: "华文彩云"; } #password { margin-top: 20px; margin-bottom: 10px; } #register { margin-left: 70px; } ``` 以上是一个简单的登录界面,其中使用了HTMLCSS来实现页面布局和样式。HTML代码包含了一个登录框的结构,包括账号输入框、密码输入框和登录、注册按钮等元素。CSS代码则定义了各个元素的样式,包括字体、颜色、大小、布局等。可以根据需要进行调整和修改。<span class="em">1</span><span class="em">2</span> #### 引用[.reference_title] - *1* [html+css 登录界面](https://blog.csdn.net/nppe6/article/details/125100555)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [用html+css制作简单好看的登陆注册界面](https://blog.csdn.net/weixin_47971206/article/details/118916419)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值