一、html文件
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!--设计网页标题-->
<title>京东-欢迎登录</title>
<!--设置网页图标-->
<link rel="icon" type="image/ico" href="img/aaa.ico"/>
<!--导入样式表-->
<link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<!--顶部-->
<div id="header">
<!--顶部的顶部-->
<div id="top">
<div>
<img src="img/logo.png"/>
<img src="img/l-icon.png"/>
</div>
<a id="survey" target="_blank" href="https://surveys.jd.com/index.php?r=survey/index/sid/568245/lang/zh-Hans">登录界面,调查问卷</a>
</div>
<!--顶部的底部-->
<div id="bottom">
<p><img src="img/warning.png">  依据《网络安全法》,为保障您的账户安全和正常使用,请尽快完成手机号验证! 新版<a target="_blank" href="https://about.jd.com/privacy/">《京东隐私政策》</a>已上线,将更有利于保护您的个人隐私。</img>
</div>
</div>
<!--中间-->
<div id="content">
<!--登录框-->
<div id="login_page">
<!--提示块-->
<div id="div1">
<img src="img/xx.png"/>
<p>京东不会以任何理由要求您转账汇款,谨防诈骗。</p>
</div>
<!--按钮块-->
<div id="div2">
<button>扫码登录</button>|<button>账号登录</button>
</div>
<!--信息收集块-->
<div id="div3">
<div>
<img src="img/pygame.png"/>
<input type="text" name="username" id="" value="" placeholder="邮箱/用户名/已验证手机"/>
</div>
<div>
<img src="img/password_icon.png"/>
<input type="password" name="password" placeholder="密码"/>
</div>
<a href="https://aq.jd.com/process/findPwd?s=1">忘记密码?</a>
<button>登  录</button>
</div>
<!--注册和第三方登录-->
<div id="div4">
<a id="a1" href="https://graph.qq.com/oauth2.0/show?which=Login&display=pc&response_type=code&state=1F2B3CB0C4969963A77159F8D795CE5288AFCA6743715844FBCC79DB7E51B04004943650F2D811B6D7E744374EF1F38E&client_id=100273020&redirect_uri=https%3A%2F%2Fqq.jd.com%2Fnew%2Fqq%2Fcallback.action%3Fview%3Dnull%26uuid%3D984cb89525374e19b1c5d997792f2208">QQ</a>|
<a id="a2" href="https://open.weixin.qq.com/connect/qrconnect?appid=wx827225356b689e24&state=01BECDFE3AFD56191252E004936D027D31D251815ACA64E13D698190653999F0517C4D8C8DC73D34AB3E1076EE9035E8&redirect_uri=https%3A%2F%2Fqq.jd.com%2Fnew%2Fwx%2Fcallback.action%3Fview%3Dnull%26uuid%3D961b912f370e44f7b28c3303da0bc653&response_type=code&scope=snsapi_login#wechat_redirect">微信</a>
<a id="a3" href="https://reg.jd.com/reg/person?ReturnUrl=http%3A%2F%2Fwww.jd.com">立刻注册</a>
</div>
</div>
</div>
<!--底部-->
<div id="footer">
<div>
<a href="https://www.jd.com/">关于我们</a>|
<a href="http://about.jd.com/contact">联系我们</a>|
<a href="http://zhaopin.jd.com/home;jsessionid=7088B99966700FBDB56E61F8FF8D1AC7.s1">人才招聘</a>|
<a href="https://www.jd.com/">商家入驻</a>|
<a href="https://www.jd.com/">广告服务</a>|
<a href="https://app.jd.com/">手机京东</a>|
<a href="https://club.jd.com/links.aspx">友情链接</a>|
<a href="https://media.jd.com/">销售联盟</a>|
<a href="https://sale.jd.com/act/n0hAvqy5CW8.html">京东社区</a>|
<a href="https://gongyi.jd.com/">京东公益</a>|
<a href="https://www.jd.com/">English site</a>
</div>
<p>Copyright © 2004-2018 京东JD.com 版权所有</p>
</div>
</body>
</html>
二、css样式文件
/*(通用)*/
*{
/*消除默认的margin*/
margin: 0;
/*消除默认的padding*/
padding: 0;
/*让所有标签的子标签都相对自己定位*/
position: relative;
}
/*顶部*/
#header{
height: 100px;
background-color: beige;
}
/*顶部的顶部*/
#header #top{
height: 70px;
background-color:white;
}
#header #top div{
width: 300px;
height: 70px;
/*脱流*/
position: absolute;
left: 190px;
/*垂直居中*/
top: 50%;
margin-top: -30px;
line-height: 60px;
}
#header #top #survey{
/*布局*/
position: absolute;
right: 190px;
top: 40px;
/*去除下划线*/
text-decoration: none;
/*文字颜色 大小*/
color:gray;
font-size: 12px;
/*添加背景图
* background:url(图片地址) (是否平铺)repeat/norepeat x y 背景颜色
* x坐标和y坐标对应的值,除了可以设置数字以外,也可以设置center,让背景图在x坐标和有坐标居中
* */
padding-left: 23px;
background: url(../img/q-icon.png) no-repeat 0 center ;
}
#header #top #survey:hover{
color: red;
text-decoration: underline
}
/*顶部的底部*/
#header #bottom{
height: 30px;
background-color: rgb(255,248,240);
}
/*设置字的格式*/
#header #bottom p{
/*垂直方向居中*/
height:30px;
line-height: 30px;
/*水平方向居中*/
text-align: center;
/*设置字体大小*/
font-size: 12px;
}
#header #bottom p img{
/*垂直居中*/
height:16px;
position: absolute;
top: 30px;
margin-top:-22px ;
line-height: 15px;
}
/*中间*/
#content{
height: 430px;
background: url(../img/bg1.png)150px center no-repeat rgb(220,45,19);
}
/*登录界面*/
#content #login_page{
width: 350px;
height: 350px;
background-color: white;
/*定位*/
position: absolute;
right: 150px;
top: 40px;
}
/*提示块*/
#content #login_page #div1{
height:30px;
background-color: rgb(255,246,236);
}
#div1 img{
height: 16px;
position: absolute;
left: 24px;
top: 8px;
}
#div1 p{
height: 30px;
line-height: 30px;
font-size: 12px;
text-align: center;
color: darkgray;
}
#div1 a{
color: aqua;
text-decoration: none;
}
#div a:hover{
color: red;
text-decoration: underline;
}
/*选中登录方式*/
#content #login_page #div2{
height: 50px;
background-color:white;
color: rgb(220,220,220,0.6);
/*设置求字体粗细:取值范围是100-900*/
font-weight: 100;
}
#div2 button{
width: 48%;
height: 100%;
border:0;
font-size: 20px;
background-color: white;
color:rgb(60,60,60);
}
/*设置按钮成为焦点的状态*/
#div2 button:focus{
color: red;
/*按钮成为焦点默认的边款效果是outline*/
outline: 0;
}
/*信息收集块*/
#content #login_page #div3{
height: 220px;
border-top: solid gainsboro 1px;
border-bottom: solid gainsboro 1px;
}
#div3 div{
width: 300px;
height: 40px;
margin-left: 25px;
margin-top: 23px;
border:solid black 1px ;
}
#div3 img{
width: 40px;
height: 40px;
float: left;
}
#div3 input{
width: 200px;
height: 40px;
float: left;
border: 0;
padding-left:10px ;
font-size: 14px;
}
#div3 input:focus{
outline:0;
}
/*忘记密码*/
#div3 a{
position: absolute;
right: 25px;
margin-top: 10px;
color: rgb(89,89,89);
font-size: 12px;
text-decoration: none;
}
#div3 a:hover{
color: red;
text-decoration: underline;
}
/*登录按钮*/
#div3 button{
width: 300px;
margin-left: 25px;
margin-top:40px;
height: 35px;
position: absolute;
bottom: 20px;
background-color: red;
border: 0;
color: white;
font-size: 20px;
}
/**/
#content #login_page #div4{
/*垂直方向居中*/
height: 40px;
line-height: 40px;
font-size: 8px;
color: rgb(220,220,220,0.6);
}
#a1{
margin-left: 20px;
color: black;
font-size:14px ;
text-decoration: none;
background: url(../img/qq.png) no-repeat 0 center white;
padding-left: 25px;
margin-right: 20px;
}
#a2{
margin-left:20px ;
color: black;
font-size: 14px;
text-decoration: none;
background: url(../img/weixin.png) no-repeat 0 center white;
padding-left: 25px;
}
#a3{
position: absolute;
right: 25px;
color: rgb(165,19,23);
font-size: 14px;
text-decoration: none;
background: url(../img/right.png) no-repeat 0 center white;
padding-left: 25px;
}
#div4 #a1:hover{
color: red;
text-decoration: underline;
}
#div4 #a2:hover{
color: red;
text-decoration: underline;
}
#div4 #a3:hover{
color: red;
text-decoration: underline;
}
/*底部*/
#footer{
height: 100px;
color: darkgrey;
}
#footer div{
height: 50px;
background-color:;
/*垂直居中*/
text-align: center;
/*水平居中*/
line-height: 50px;
font-size: 14px;
color: darkgrey;
}
#footer div a{
margin-left: 15px;
margin-right: 15px;
color: darkgrey;
text-decoration: none;
}
#footer div a:hover{
color: red;
text-decoration: underline;
}
#footer p{
color: darkgray;
font-size: 14px;
text-align: center;
}
三、效果