京東頁面html代碼
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>京東-歡迎登錄</title>
<link rel="icon" type="image/ico" href="img/jd_logo.ico"/>
<!--關閉所有標簽默認的margin和padding-->
<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>
<!--============================網頁的頂部===============================-->
<div id="top">
<div id="icon">
<!--圖標圖片-->
<div id="image">
<a >
<img src="img/logo.png" alt="" />
</a>
<img src="img/l-icon.png" alt="" />
</div>
<!--調查問卷-->
<a href="" id="questionnaire">登錄頁面,調查問卷</a>
</div>
<div id="privacy">
<p><img src="img/xx.png" alt="" />  依據《網絡安全法》,為保障您的賬戶安全和正常使用,請盡快完成手機號驗證! 新版<a target="_blank" >《京東隱私政策》</a>已上線,將更有利于保護您的個人隱私。</p>
</div>
</div>
<!--============================網頁中間內容==============================-->
<div id="middle">
<div id="login-box">
<div id="box1">
<!--警告-->
<div id="warning">
<img src="img/xx.png"/>
<font>京東不會以任何理由要求您轉賬匯款,謹防詐騙。</font>
</div>
<!--登錄方式選擇-->
<div id="choice">
<button>掃碼登錄</button>|
<button>賬號登錄</button>
</div>
</div>
<!--賬號密碼-->
<div id="box2">
<div id="user-name">
<label for="for1"><img src="img/pygame.png" /></label>
<input type="" name="" id="for1" value="" placeholder="郵箱/用戶名/已驗證手機"/>
</div>
<div id="password">
<label for="for2"><img src="img/password_icon.png"/></label>
<input type="password" name="" id="for2" 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">立即注冊</a>
</div>
</div>
</div>
<!--============================網頁的底部=================================-->
<div id="bottom">
<div>
<a href="">關于我們</a><font>|</font>
<a href="">聯系我們</a><font>|</font>
<a href="">人才招聘</a><font>|</font>
<a href="">商家入駐</a><font>|</font>
<a href="">廣告服務</a><font>|</font>
<a href="">手機京東</a><font>|</font>
<a href="">友情鏈接</a><font>|</font>
<a href="">銷售聯盟</a><font>|</font>
<a href="">京東社區</a><font>|</font>
<a href="">京東公益</a><font>|</font>
<a href="">English Site</a>
</div>
<p>Copyright ? 2004-2019 京東JD.com 版權所有</p>
</div>
</body>
</html>
京東頁面用到的CSS代碼
#top{
height: 120px;
}
/*===============圖標頂部==============*/
#top #icon{
height: 80px;
/*想要icon的子標簽在絕對定位的時候相對自己定位*/
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;
/*設置背景圖片
* background:圖片地址 是否平鋪 水平方向的位置 垂直方向的位置 背景顏色
*/
background:url(../img/q-icon.png) no-repeat 0 center rgba(255,0,0,0);
/*設置padding讓文字往后挪*/
padding-left: 22px;
/*margin-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{
/*垂直方向居中(在父標簽中)
* 1)設置高度和父標簽一樣
* 2)設置行高和自己的高度一樣
*/
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;
/*text-decoration:*/
}
#middle{
height: 475px;
/*background-color: lightgoldenrodyellow;*/
/*設置背景*/
background: url(../img/bg2.png) no-repeat 100px 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);
/*內容垂直方向居中*/
height: 40px;
line-height: 40px;
/*設置水平方向布局方式*/
text-align: center;
}
#middle #login-box #box1 #warning font{
font-size: 12px;
color: rgb(147,147,147);
}
#middle #login-box #box1 #warning img{
/*內容垂直方向的布局方式*/
vertical-align: middle;
}
/*登錄方式選擇*/
#middle #login-box #box1 #choice{
height: 55px;
color: rgb(242,242,242);
font-size: 20px;
/*設置字體的粗細*/
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);
}
/*設置按鈕成為焦點時的樣式*/
#middle #login-box #box1 #choice button:focus{
/*按鈕成為焦點是外面默認的邊框是outline*/
outline: 0;
color: rgb(217,46,56);
}
/*=====第二塊======*/
#middle #login-box #box2{
/*background-color: lightcyan;*/
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;
border: 1px solid rgb(184,184,184);
margin-left: 20px;
margin-top: 30px;
}
#middle #login-box #box2 #password{
margin-top: 20px;
}
/*輸入框中的圖片*/
#middle #login-box #box2 div img{
width: 40px;
height: 40px;
border-right: 1px solid rgb(184,184,184);
}
/*input標簽*/
#middle #login-box #box2 div input{
width: 260px;
height: 100%;
/*background-color: black;*/
vertical-align: top;
border: 0;
font-size: 14px;
}
#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{
color: rgb(216,48,60);
text-decoration: underline;
}
/*=========第三塊========*/
#middle #login-box #box3{
height: 50px;
line-height: 50px;
}
#middle #login-box #box3 a{
text-decoration: none;
font-size: 13px;
color: rgb(147,147,147);
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;
margin-left: 16px;
margin-right: 13px;
font-size: 10px;
color: rgb(240,240,240);
}
/*微信*/
#middle #login-box #box3 #weixin{
float: left;
background: url(../img/weixin.png) no-repeat 0 center rgba(0,0,0,0);
}
/*注冊*/
#middle #login-box #box3 #register{
float: right;
margin-right: 20px;
font-size: 14px;
color: rgb(155,27,36);
background: url(../img/right.png) no-repeat 0 center rgba(0,0,0,0);
}
#bottom{
/*background-color: lightpink;*/
height: 105px;
}
#bottom div{
/*background-color: lightcyan;*/
height: 50px;
line-height: 50px;
text-align: center;
}
#bottom p{
text-align: center;
font-size: 12px;
color: rgb(97,97,97);
}
#bottom font{
margin-left: 10px;
margin-right: 10px;
font-size: 10px;
color: rgb(97,97,97);
font-weight: 500;
}
#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>
<!--頁面基本布局-->
<style type="text/css">
#box{
height: 50px;
background-color: rgb(220,220,220);
line-height: 50px;
}
/*=============下拉菜單============*/
#menu{
margin-left: 100px;
float: left;
/*父標簽寬度必須設置*/
width: 100px;
}
/*菜單按鈕的默認狀態*/
#menu font{
display: inline-block;
/*background-color: lavenderblush;*/
width: 100px;
height: 50px;
text-align: center;
}
/*彈出框出現的狀態*/
#menu #content{
width: 200px;
height: 150px;
background-color: white;
border: 1px solid rgb(180,180,180);
/*開始隱藏*/
display: none;
margin-top: -1px;
}
/*當鼠標懸停在id是menu的標簽上時,去設置id是content的樣式*/
#menu:hover #content{
display: block;
}
#menu:hover font{
border-left: 1px solid rgb(180,180,180);
border-right: 1px solid rgb(180,180,180);
border-top: 1px solid rgb(180,180,180);
background-color: white
}
/*其他菜單*/
.other{
float: left;
width: 100px;
height: 50px;
/*background-color: yellowgreen;*/
}
</style>
</head>
<body>
<div id="box">
<!--下拉菜單-->
<div id="menu">
<font>下拉菜單</font>
<div id="content"></div>
</div>
<!--其他菜單-->
<div class="other">
</div>
</div>
</body>
</html>
<style>
a{
background: url() no-repeat 0 center rgb()
}
</style>