top.css
#top{
height: 120px;
/*background-color: lightblue;*/
}
/*圖標(biāo)頂部*/
#top #icon{
height: 80px;
/*想要icon子標(biāo)簽在絕對(duì)定位的時(shí)候相對(duì)自己定位*/
position: relative;
}
#top #icon #image{
position: absolute;
left: 186px;
/*垂直方向居中*/
top: 50%;
margin-top: -30px;
}
#top #icon #questionnaire{
position: absolute;
right: 188px;
bottom: 10px;
/*字體*/
font-size:12px;
color: rgb(147,147,147);
/*去掉下劃線*/
text-decoration: none;
/*設(shè)置背景圖片
*background:圖片地址 是否平鋪 水平方向的位置 垂直方向的位置 背景顏色
*/
background:url(../img/q-icon.png) no-repeat 0 center rgba(0,0,0,0) ;
/*padding讓文字往后挪*/
padding-left: 22px;
}
#top #icon #questionnaire:hover{
color: rgb(216,48,60);
text-decoration: underline;
}
/*隱私政策*/
#top #privacy{
background-color: rgb(255,246,236);
height: 40px;
}
#top #privacy p{
/*垂直方向居中(在父標(biāo)簽中)
*1)設(shè)置高度和父標(biāo)簽一樣
*2)設(shè)置行高和自己的高度一樣
*/
height: 40px;
line-height: 40px;
text-align: center;
font-size: 12px;
color: rgb(147,147,147);
position: relative;
}
#top #privacy p img{
position: absolute;
top: 50%;
margin-top: -8px;
}
#top #privacy p a{
color: rgb(50,50,50);
text-decoration: none;
}
#top #privacy p a:hover{
text-decoration: underline;
color: rgb(216,48,60);
}
middle.css
#middle{
height: 475px;
/*background-color: lightgoldenrodyellow;*/
background: url(../img/bg2.png) no-repeat 150px center rgb(71,147,202);
}
#middle #login-box{
width: 350px;
height: 400px;
background-color: white;
float: right;
margin-right: 188px;
margin-top: 10px;
}
/*================================第一塊=========================*/
#middle #login-box #box1{
height: 95px;
}
/*警告*/
#middle #login-box #box1 #warning{
background-color: rgb(255,246,236);
/*內(nèi)容垂直方向居中*/
height: 40px;
line-height: 40px;
/*設(shè)置水平方向布局方式*/
text-align: center;
}
#middle #login-box #box1 #warning font{
font-size: 12px;
color: rgb(147,147,147);
}
#middle #login-box #box1 #warning img{
/*內(nèi)容垂直方向的布局方式*/
vertical-align: middle;
}
/*選擇*/
#middle #login-box #box1 #choice{
height: 55px;
color: rgb(242,242,242);
font-size: 17px;
font-weight: 100;
}
#middle #login-box #box1 #choice button{
width: 170px;
height: 100%;
background-color: rgba(0,0,0,0);
border: 0;
font-size: 20px;
color: rgb(94,92,93);
}
/*設(shè)置按鈕成為焦點(diǎn)時(shí)的樣式*/
#middle #login-box #box1 #choice button:focus{
color: rgb(217,46,56);
/*按鈕成為焦點(diǎn)時(shí)外面默認(rèn)的邊框是outline*/
outline: 0;
}
/*=================================第二塊==========================================*/
#middle #login-box #box2{
height: 255px;
border-top: 1px solid rgb(240,240,240);
border-bottom: 1px solid rgb(240,240,240);
position: relative;
}
#middle #login-box #box2 div{
width: 310px;
height: 40px;
background-color: white;
border: 1px solid rgb(150,150,150);
margin-top: 30px;
margin-left: 20px;
}
#middle #login-box #box2 #user-name{
margin-top: 30px;
}
#middle #login-box #box2 #password{
margin-top: 20px;
}
/*輸入框中的圖片*/
#middle #login-box #box2 div img{
width: 40px;
height: 40px;
border: 1px solid rgb(184,184,184);
/*margin-left: 20px;
margin-bottom: 30px;*/
}
/*input標(biāo)簽*/
#middle #login-box #box2 div input{
width: 260px;
height: 100%;
vertical-align: top;
border: 0;
outline: 0;
}
#middle #login-box #box2 div input:focus{
outline: 0;
}
/*按鈕*/
#middle #login-box #box2 button{
width: 310px;
height: 35px;
margin-left: 20px;
position: absolute;
bottom: 30px;
border: 0;
background-color: rgb(214,36,50);
font-size: 21px;
color: white;
}
#middle #login-box #box2 button:focus{
outline: 0;
}
#middle #login-box #box2 button:active{
border: 4px solid rgba(35,138,194,0.8);
}
#middle #login-box #box2 a{
position: absolute;
right: 20px;
font-size: 12px;
color: rgb(147,147,147);
text-decoration: none;
margin-top: 20px;
}
#middle #login-box #box2 a:hover{
text-decoration: underline;
color: rgb(216,48,60);
}
/*===================第三塊================*/
#middle #login-box #box3{
height: 50px;
line-height: 50px;
}
#middle #login-box #box3 a{
text-decoration: none;
font-size: 14px;
color: rgb(184,184,184);
padding-left: 25px;
}
/*QQ*/
#middle #login-box #box3 #qq{
float: left;
margin-left: 20px;
background:url(../img/qq.png) no-repeat 0 center rgba(0,0,0,0);
}
/*豎線*/
#middle #login-box #box3 font{
float: left;
font-size: 10px;
color: rgb(240,240,240);
margin-left: 16px;
margin-right: 13px;
}
/*微信*/
#middle #login-box #box3 #weixin{
float: left;
background:url(../img/weixin.png) no-repeat 0 center rgba(0,0,0,0);
}
/*注冊(cè)*/
#middle #login-box #box3 #register{
float: right;
margin-right: 20px;
font-size: 14px;
color: rgb(214,36,50);
background:url(../img/right.png) no-repeat 0 center rgba(0,0,0,0);
}
bottom.css
#bottom{
height: 105px;
/*background-color: greenyellow;*/
}
#bottom div{
/*background-color: aquamarine;*/
height: 50px;
line-height: 50px;
text-align: center;
}
#bottom p{
text-align: center;
font-size: 12px;
color: rgb(147,147,147);
}
#bottom font{
margin-left: 15px;
margin-right: 15px;
font-size: 10px;
font-weight: 700;
}
#bottom a{
font-size: 12px;
color: rgb(97,97,97);
text-decoration: none;
}
#bottom a:hover{
color: rgb(216,48,60);
text-decoration: underline;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>京東,歡迎登錄</title>
<!--關(guān)閉所欲標(biāo)簽?zāi)J(rèn)的margin和padding-->
<link rel="icon" type="image/ico" href="img/jd_logo.ico"/>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
</style>
<!--頂部樣式-->
<link rel="stylesheet" type="text/css" href="css/top.css"/>
<!--中間樣式-->
<link rel="stylesheet" type="text/css" href="css/middle.css"/>
<!--底部樣式-->
<link rel="stylesheet" type="text/css" href="css/bottom.css"/>
</head>
<body>
<!--==============網(wǎng)頁(yè)頂部====================-->
<div id="top">
<!--圖標(biāo)-->
<div id="icon">
<div id="image">
<a href="#">
<img src="img/logo.png"/>
</a>
<img src="img/l-icon.png"/>
</div>
<a href="#" id="questionnaire">登錄頁(yè)面宵荒,調(diào)查問(wèn)卷
</a>
</div>
<!--隱私-->
<div id="privacy">
<p><img src="img/xx.png"/>  從依據(jù)《網(wǎng)絡(luò)安全法》,為保障您的賬戶安全和正常使用,請(qǐng)盡快完成手機(jī)號(hào)驗(yàn)證! 新版<a target="_blank">《京東隱私政策》</a>已上線缭乘,將更有利于保護(hù)您的個(gè)人隱私澈圈。</p>
</div>
</div>
<!--==============網(wǎng)頁(yè)中間===================-->
<div id="middle">
<div id="login-box">
<div id="box1">
<div id="warning">
<img src="img/xx.png"/>
<font>京東不會(huì)以任何理由要求你轉(zhuǎn)賬匯款,謹(jǐn)防詐騙</font>
</div>
<!--登錄方式選擇-->
<div id="choice">
<button>掃碼登錄</button>|
<button>賬號(hào)登錄</button>
</div>
</div>
<!--登錄賬號(hào)密碼-->
<div id="box2">
<div id="user-name">
<label for="for1"><img src="img/pygame.png"/></label>
<input type="" name="for1" id="username" value="" placeholder="郵箱/用戶名/已驗(yàn)證手機(jī)"/>
</div>
<div id="password">
<label for="for2"><img src="img/password_icon.png"/></label>
<input type="" name="for2" id="username" value="" placeholder="密碼"/>
</div>
<a target="_blank" >忘記密碼</a>
<button>登 錄</button>
</div>
<!--第三方登錄-->
<div id="box3">
<a href="" id="qq">QQ</a><font>|</font>
<a href="" id="weixin">微信</a>
<a href="" id="register">立即注冊(cè)</a>
</div>
</div>
</div>
<!--==============網(wǎng)頁(yè)底部===================-->
<div id="bottom">
<div id="">
<a href="">關(guān)于我們</a><font>|</font>
<a href="">聯(lián)系我們</a><font>|</font>
<a href="">人才招聘</a><font>|</font>
<a href="">商家入駐</a><font>|</font>
<a href="">廣告服務(wù)</a><font>|</font>
<a href="">手機(jī)京東</a><font>|</font>
<a href="">友情鏈接</a><font>|</font>
<a href="">銷售聯(lián)盟</a><font>|</font>
<a href="">京東社區(qū)</a><font>|</font>
<a href="">京東公益</a><font>|</font>
<a href="">English Site</a><font></font>
</div>
<p>Copyright ? 2004-2019 京東JD.com 版權(quán)所有</p>
</div>
</body>
</html>
結(jié)果:
image.png