一.html
<!DOCTYPE HTML>
<html>
<head>
<!--设置网页编码方式-->
<meta charset="utf-8"/>
<!--设置网页标题-->
<title>京东-欢迎登陆</title>
<!--设置网页图标-->
<link rel="icon" type="image/ico" href="img/jd_logo.ico"/>
<!--导入css文件-->
<link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<!--============1.网页顶部================-->
<div id="header">
<!--顶部-->
<div id="top">
<!--图片-->
<div id="div1">
<a href="https://www.jd.com/"><img src="img/logo.png"/></a>
<img src="img/l-icon.png"/>
</div>
<!--调查问卷-->
<a id="a1" target="_blank" href="https://surveys.jd.com/index.php?r=survey/index/sid/568245/lang/zh-Hans">登录页面,调查问卷</a>
</div>
<!--底部-->
<div id="bottom">
<img src="img/xx.png"/>
<font>依据《网络安全法》,为保障您的账户安全和正常使用,
请尽快完成手机号验证! 新版
<a href="" target="_blank">《京东隐私政策》</a>
已上线,将更有利于保护您的个人隐私。</font>
</div>
</div>
<!--============2.网页中间================-->
<div id="content">
<!--登录框-->
<div id="login_div">
<div id="div1">
<p><img src="img/xx.png"/>  京东不会以任何理由要求您转账汇款,谨防诈骗。</p>
</div>
<div id="div2">
<button id="btn1">扫码登录</button>|
<button id="btn2">账户登录</button>
</div>
<div id="div3">
<div id="username">
<img src="img/pygame.png"/>
<input type="text" name="name" placeholder="邮箱/用户名/已验证手机"/>
</div>
<div id="password">
<img src="img/password_icon.png"/>
<input type="text" name="password" placeholder="密码"/>
</div>
<a href="https://aq.jd.com/process/findPwd?s=1" target="_blank">忘记密码</a>
<button>登 录</button>
</div>
<div id="div4">
<a href="" id="a1">QQ</a>|
<a href="" id="a2">微信</a>
<a href="" id="a3">立即注册</a>
</div>
</div>
</div>
<!--============3.网页底部================-->
<div id="footer">
<div id="div1">
<a href="">关于我们</a>|
<a href="">联系我们</a>|
<a href="">人才招聘</a>|
<a href="">商家入驻</a>|
<a href="">广告服务</a>|
<a href="">手机京东</a>|
<a href="">友情链接</a>|
<a href="">销售联盟</a>|
<a href="">京东社区</a>|
<a href="">京东公益</a>|
<a href="">English Site</a>
</div>
<div id="div2">
<font>Copyright © 2004-2018 京东JD.com 版权所有</font>
</div>
</div>
</body>
</html>
二.css
/*================通用=================*/
*{
/*取消所有自带的间距*/
margin: 0;
padding: 0;
/*所有的标签的子标签默认相对自己定位*/
position: relative;
}
a{
/*取消所有a标签的下划线*/
text-decoration: none;
}
/*============1.网页顶部================*/
#header{
height: 120px;
/*background-color: violet;*/
}
/*顶部的顶部*/
#header #top{
height: 80px;
}
/*图片*/
#header #top #div1{
/*定位*/
position: absolute;
left: 186px;
/*垂直居中
* 当前标签高度是60px
*/
position: absolute;
top: 50%;
/*高度一半*/
margin-top: -30px;
}
/*调查问卷*/
#header #top #a1{
/*定位*/
position: absolute;
right: 190px;
bottom: 10px;
/*文字效果*/
font-size: 12px;
color: rgb(150,150,150);
/*背景图
*background:图片地址 是否平铺 x坐标 y坐标
*
*/
padding-left: 23px;
background: url(../img/q-icon.png) no-repeat 0px center white;
}
#header #top #a1:hover{
color: red;
text-decoration: underline;
}
/*顶部的底部*/
#header #bottom{
height: 40px;
background-color: rgb(255,246,236);
/*水平方向居中*/
text-align: center;
/*文字垂直方向居中*/
line-height: 40px;
}
#header #bottom font{
/*文字整体右移*/
margin-left: 20px;
/*文字大小和颜色*/
font-size: 13px;
color: rgb(150,150,150);
}
#header #bottom font a{
color: rgb(38,38,38);
}
#header #bottom font a:hover{
text-decoration: underline;
}
#header #bottom img{
/*图片垂直方向居中*/
position: absolute;
top: 50%;
margin-top: -8px;
}
/*============2.网页中间================*/
#content{
height: 470px;
/*背景图*/
background: url(../img/bg2.png) no-repeat 20% center rgb(100,171,219);
}
#content #login_div{
width: 350px;
height: 400px;
background-color: white;
/*定位*/
position: absolute;
right: 188px;
top: 15px;
}
#content #login_div #div1{
height: 10%;
background-color: rgb(255,246,236);
line-height: 40px;
}
#content #login_div #div1 p{
font-size: 12px;
color: rgb(150,150,150);
text-align: center;
}
#content #login_div #div1 p img{
/*图片垂直居中*/
position: absolute;
top: 50%;
margin-top: -8px;
}
#content #login_div #div2{
height: 13.5%;/*55px*/
/*background-color: black;*/
/*调整竖线的颜色和大小*/
color: rgba(220,220,220,0.6);
font-weight: 900;
font-size: 10px;
}
#content #login_div #div2 button{
background-color: white;
border: 0;
width: 170px;
height: 100%;
color: rgb(83,83,83);
font-size: 19px;
font-weight: 700;
}
/*focus - 成为焦点对应的状态*/
#content #login_div #div2 button:focus{
/*去掉outline*/
outline: 0;
color: rgb(215,36,50);
}
#content #login_div #div3{
height: 65%;
/*background-color: white;*/
border-top: 1px solid rgba(220,220,220,0.6);
border-bottom: 1px solid rgba(220,220,220,0.6);
}
/*账号密码框*/
#content #login_div #div3 #username,#content #login_div #div3 #password{
height: 40px;
/*background-color: yellow;*/
position: absolute;
left: 20px;
right: 20px;
top: 30px;
width: auto;
border: 1px solid rgba(220,220,220,1);
}
#content #login_div #div3 #password{
top: 90px;
}
/*输入框中的图片*/
#content #login_div #div3 img{
width: 40px;
height: 40px;
float: left;
border-right: 1px solid rgba(220,220,220,1);
}
/*输入框*/
#content #login_div #div3 input{
border: 0;
height: 40px;
width: 250px;
float: left;
/*向右移动光标*/
padding-left: 10px;
font-size: 14px;
}
#content #login_div #div3 input:focus{
outline: 0;
}
/*忘记密码*/
#content #login_div #div3 a{
position: absolute;
right: 20px;
top: 150px;
font-size: 13px;
color: rgb(85,85,85);
}
#content #login_div #div3 a:hover{
text-decoration: underline;
color: red;
}
/*登录按钮*/
#content #login_div #div3 button{
position: absolute;
bottom: 30px;
left: 20px;
width: 310px;
height: 35px;
background-color: rgb(210,35,50);
border: none;
font-size: 20px;
color: white;
}
#content #login_div #div3 button:focus{
outline: 0;
}
#content #login_div #div3 button:active{
border: 2px solid deepskyblue;
/*outline: 3px solid skyblue;*/
/*设置圆角*/
border-radius: 3px;
}
/*第三方登录和注册*/
#content #login_div #div4{
height: 12.5%;
/*background-color: black;*/
line-height: 50px;
font-size: 13px;
/*color: rgb(83,83,83);*/
color: rgba(220,220,220,0.6);
/*font-weight: 900;*/
}
#content #login_div #div4 #a1{
margin-left: 20px;
margin-right: 20px;
background: url(../img/qq.png) no-repeat 0px center rgba(0,0,0,0);
padding-left: 26px;
color: rgb(83,83,83);
}
#content #login_div #div4 #a2{
margin-left: 20px;
background: url(../img/weixin.png) no-repeat 0px center rgba(0,0,0,0);
padding-left: 26px;
color: rgb(83,83,83);
}
#content #login_div #div4 #a3{
position: absolute;
right: 20px;
background: url(../img/right.png) no-repeat 0px center rgba(0,0,0,0);
padding-left: 26px;
color: rgb(210,35,50);
}
#content #login_div #div4 #a1:hover{
text-decoration: underline;
color: rgb(210,35,50);
}
#content #login_div #div4 #a2:hover{
text-decoration: underline;
color: rgb(210,35,50);
}
#content #login_div #div4 #a3:hover{
text-decoration: underline;
color: rgb(210,35,50);
}
/*============3.网页底部================*/
#footer{
height: 110px;
/*background-color: red;*/
}
#footer #div1{
height: 60px;
line-height: 60px;
text-align: center;
/*background-color: #EE82EE;*/
font-size: 13px;
}
#footer #div2{
height: 50px;
text-align: center;
/*line-height: 50px;*/
font-size: 13px;
}
#footer #div1 a{
margin-left: 10px;
margin-right: 10px;
}
#footer #div1 a:hover{
color: red;
text-decoration: underline;
}