1. 程式人生 > >前端學習筆記day11 京東電商專案2

前端學習筆記day11 京東電商專案2

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>京東(JD.COM)-綜合網購首選,正品低價,品質保證,配送及時,輕鬆購物</title>
    <meta name="description" content="京東JD.COM-專業的綜合網上購物商城,銷售家電、數碼通訊、電腦、家居百貨、服裝服飾、母嬰、圖書、食品等數萬個品牌優質商品.便捷、誠信的服務,為您提供愉悅的網上購物體驗!" />
<meta name="Keywords" content="網上購物,網上商城,手機,筆記本,電腦,MP3,CD,VCD,DV,相機,數碼,配件,手錶,儲存卡,京東""/> <link rel="shortcut icon" href="favicon.ico"> <link rel="stylesheet" type="text/css" href="CSS/normalize.css"> <link rel="stylesheet" type="text/css" href="CSS/base.css"> <
link rel="stylesheet" type="text/css" href="CSS/index.css"> </head> <body> <!-- 頁面頭部分start --> <header> <div class="w"></div> </header> <!-- 頁面頭部分end --> <!-- 個人資訊部分start --> <div class="info"> <ul
class="w"> <li><span></span><a href="#">北京</a></li> <li><a href="#">你好,請登入 <span>免費註冊</span></a></li> <li><i class="line"></i></li> <li><a href="#">我的訂單</a></li> <li><i class="line"></i></li> <li><a href="#">我的京東</a><span class="arrow-b"></span></li> <li><i class="line"></i></li> <li><a href="#">京東會員</a></li> <li><i class="line"></i></li> <li><a href="#">企業採購</a></li> <li><i class="line"></i></li> <li><a href="#">客戶服務</a></li> <li><i class="line"></i></li> <li><a href="#">網站導航</a></li> <li><i class="line"></i></li> <li><a href="#">手機京東</a><img src="images/mobile.png" alt=""></li> </ul> </div> <!-- 個人資訊部分end --> <!-- 搜尋框部分start --> <div class="search w"> <div class="logo"></div> <form> <input type="text" name="" placeholder="掃描器"> <button></button> </form> <div class="shopping-car"> <span><i></i>我的購物車</span> <span>0</span> </div> <div class="text"> <ul> <li><a href="#">199減100</a></li> <li><a href="#">滑鼠試用</a></li> <li><a href="#">農貿7折</a></li> <li><a href="#">低至29元</a></li> <li><a href="#">抽獎贏空調</a></li> <li><a href="#">記憶棉</a></li> <li><a href="#">坐墊</a></li> <li><a href="#">1分錢買油</a></li> <li><a href="#">智慧手錶</a></li> </ul> </div> <div class="text-b"> <ul> <li><a href="#">秒殺</a></li> <li><a href="#">優惠券</a></li> <li><a href="#">閃購</a></li> <li><a href="#">拍賣</a></li> <li><span class="line"></span></li> <li><a href="#">服裝城</a></li> <li><a href="#">京東超市</a></li> <li><a href="#">生鮮</a></li> <li><a href="#">全球購</a></li> <li><span class="line"></span></li> <li><a href="#">京東金融</a></li> </ul> </div> <div class="img-r"> <a href="#"><img src="images/super.png"></a> </div> </div> <!-- 搜尋框部分end --> <!-- 頁面中間部分 --> <div class="middle w"> <div class="middle-l"> <div class="ad"> <img src="images/ad-l.png"> <div class="ad-r"></div> </div> <ul> <li><a href="#">家用電器</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">手機/執行商/數碼</a></li> <li><a href="#">影象/音響/電子書</a></li> <li><a href="#">手機/運營商/數碼</a></li> <li><a href="#">理財/眾籌/白條/保險</a></li> </ul> </div> <div class="middle-m"> <div class="middle-m-t"> <div class="arrow-l"><a href="#"> < </a></div> <div class="arrow-r"><a href="#"> > </a></div> <img src="images/banner.jpg"> <div class="circle"> <ul> <li></li> <li></li> <li class="current"></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </div> </div> <div class="middle-m-b"> <div class="middle-m-b-l"> <img src="images/l.jpg"> </div> <div class="middle-m-b-r"> <img src="images/r.jpg"> </div> </div> </div> <div class="middle-r"> <div class="middle-r-t"> <p>Hi,歡迎來到京東購物網站! </p> <p> <a href="#">登入</a><a href="#">註冊</a> </p> <div class="middle-r-t-b"> <div><a href="#">新人福利</a></div> <div><a href="#">PLUS會員</a></div> </div> <div class="middle-r-t-img"> <img src="images/no_login.jpg"> </div> </div> <div class="moddle-r-m"> <dl> <dt> <a href="#">促銷</a> <span></span> <a href="#">公告</a> <a href="#">更多</a> </dt> <dd><a href="#">挑戰3天不洗頭</a></dd> <dd><a href="#">挑戰3天不洗頭</a></dd> <dd><a href="#">益生菌領券滿399減100</a></dd> <dd><a href="#">益生菌領券滿399減100</a></dd> </dl> </div> <div class="middle-r-b"> <ul> <li><a href="#"><span></span>話費</a></li> <li><a href="#"><span></span>話費</a></li> <li><a href="#"><span></span>話費</a></li> <li><a href="#"><span></span>話費</a></li> <li><a href="#"><span></span>話費</a></li> <li><a href="#"><span></span>話費</a></li> <li><a href="#"><span></span>話費</a></li> <li><a href="#"><span></span>話費</a></li> <li><a href="#"><span></span>話費</a></li> <li><a href="#"><span></span>話費</a></li> <li><a href="#"><span></span>話費</a></li> <li><a href="#"><span></span>話費</a></li> </ul> </div> </div> </div> <!-- 頁面底部分start --> <div class="footer"> <!-- 底部的上面部分 --> <div class="footer-t"> <ul> <li><span class="img-1"></span>品類齊全,輕鬆購物</li> <li><span class="img-2"></span>品類齊全,輕鬆購物</li> <li><span class="img-3"></span>品類齊全,輕鬆購物</li> <li><span class="img-4"></span>品類齊全,輕鬆購物</li> </ul> </div> <div class="footer-m w"> <div class="footer-m-l"> <dl> <dt>購物指南</dt> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> </dl> <dl> <dt>購物指南</dt> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> </dl> <dl> <dt>購物指南</dt> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> </dl> <dl> <dt>購物指南</dt> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> </dl> <dl> <dt>購物指南</dt> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> <dd>購物流程</dd> </dl> </div> <div class="footer-m-r"> <h4>京東自營覆蓋區縣</h4> <p>京東已向全國2661個區縣提供自</p> <p>營配送服務,支援貨到付款、</p> <p>POS機刷卡和售後上門服務。</p> <p>檢視詳情 <span>></span> </p> </div> </div> <div class="footer-about w"> <ul> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">關於我們</a></li> </ul> </div> <div class="footer-law w"> <p>京公網安備 11000002000088號<span></span>京ICP證070359號<span></span>網際網路藥品資訊服務資格證編號(京)-經營性-2014-0008 <span></span>新出發京零 字第大120007號</p> <p>網際網路出版許可證編號新出網證(京)字150號<span></span>出版物經營許可證<span></span>網路文化經營許可證京網文[2014]2148-348號<span></span>違法和不良資訊舉報電話:4006561155</p> <p>Copyright © 2004 - 2017 京東JD.com 版權所有<span></span>消費者維權熱線:4006067733經營證照 京東旗下網站:京東支付<span></span>京東雲</p> </div> <div class="footer-b w"> <ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </div> </div> <!-- 頁面底部分end--> </body> </html>
View Code
.middle {
    overflow: hidden;
    margin-bottom: 40px;
}
.middle .middle-l {
    float: left;
}
.middle .middle-l ul {
    width: 180px;
    height: 490px;
    background-color: grey;
    padding-top: 10px;
    font-size: 14px;
    line-height: 29px;
    box-sizing: border-box;
}
.middle .middle-l img {
    position: absolute;
    top: 249px;
    left: -58px;
}
.middle .middle-l .ad-r {
    position: absolute;
    background: url("../images/ad-r.jpg");
    left: 192px;
    top: 262px;
    z-index: 999;
    width: 0px;
    height: 492px;
    transition: all 0.8s;
}
.ad:hover .ad-r {  
    width: 990px;
}
.middle .middle-l ul li a {
    width: 180px;
    display: block;
    color: #fff;
    padding-left: 14px;
    box-sizing: border-box;
}
.middle .middle-l a:hover {
    color: red;
    background-color: #ccc;
}
.middle .middle-m {
    width: 791px;
    height:490px;
    float: left;
    padding-left: 16px;
}
.middle .middle-m-t {
    width: 100%;
    height: 361px;
    padding-bottom: 20px;
    box-sizing: border-box;
    position: relative;
}
.middle-m-b {
    width: 100%;
    height: 139px;
}
.middle-m-b .middle-m-b-l {
    float: left;
}
.middle-m-b .middle-m-b-r {
    float: right;
}
.middle-m-b img {
    vertical-align: top;
}
.middle-m-t .arrow-l,.middle-m-t .arrow-r {
    position: absolute;
    width: 26px;
    height: 50px;
    background-color: rgba(0,0,0,0.3);
    font-size: 24px;
    text-align: center;
    line-height: 50px;
    top: 50%;
    transform: translateY(-50%);
}
.middle-m-t .arrow-r {
    right: 0px;
}
.middle-m-t .arrow-l a,.middle-m-t .arrow-r a {
    color: #fff;
}
.middle-m-t a:hover {
    color: red;
} 
.middle-m-t .circle {
    width: 191px;
    height: 22px;
    background: rgba(255,255,255,0.4);
    border-radius: 10px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 40px;
    padding-left: 7px;
    box-sizing: border-box;
}
.circle ul li {
    float: left;
    width: 12px;
    height: 12px;
    background-color: #fff;
    border-radius: 50%;
    margin: 5px 5px;
    cursor: pointer;
}
.circle ul .current {
    background-color: red;
}
.middle .middle-r {
    width: 202px;
    height: 491px;
    float: right;
}
.middle-r {
    background-color: #fdfcfc;
}
.middle-r .middle-r-t {
    width: 100%;
    height: 100px;
    padding: 10px 10px;
    font-size: 14px;
    position: relative;
    border-bottom: 1px solid grey;
}
.middle-r-t p:nth-child(1) {
    width: 114px;
    position: absolute;
    right: 41px;
    top: 21px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.middle-r-t p:nth-child(2) {
    width: 70px;
    height: 30px;
    position: absolute;
    top: 41px;
    right: 85px;
    text-align: center;
    line-height: 30px;
    padding: 0px 4px;
}
.middle-r-t p a {
    color: #000;
    padding-right: 4px;
}
.middle-r-t p a:hover {
    color: red;
}
.middle-r-t-b {
    width: 158px;
    height: 30px;
    position: absolute;
    bottom: 20px;
    left: 20px;
    padding-left: 2px;
}
.middle-r-t-b div {
    width: 69px;
    height: 28px;
    border: 2px solid red;
    float: left;
    margin: 0px 3px;
    text-align: center;
    line-height: 28px;
    
}
.middle-r-t-b div a {
    width: 69px;
    display: inline-block;
    font-size: 14px;
    color: red;
}
.middle-r-t-b div a:hover {
    color: #fff;
    background-color: red;
}
.middle-r-t-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid red;
    overflow: hidden;
    box-sizing: border-box;
    position: absolute;
    top: 18px;
    left: 10px;
}
.middle-r-t-img img {
    width: 36px;
    border-radius: 50%;
    margin: 2px;
}
.moddle-r-m {
    width: 176px;
    height: 170px;
    margin: 0px auto;
}
.moddle-r-m dt {
    width: 100%;
    height: 28px;
    font-size: 12px;
    border-bottom: 1px solid grey;
    
}
.moddle-r-m dt a {
    color: grey;
    display: inline-block;
    height: 15px;
    line-height: 15px;
    margin: 8px 21px 8px 0px;
    padding-bottom: 4px;
}
.moddle-r-m dt a:first-child {
    border-bottom: 2px solid red;
}
.moddle-r-m dt span {
    width: 1px;
    height: 15px;
    background-color: grey;
    display: inline-block;
    margin: 3px 10px -4px -5px;
    
}
.moddle-r-m dt a:last-child {
    margin-right: 0px;
    padding-right: 0px;
    float: right;
}
.moddle-r-m dd {
    padding-top: 19px;
    line-height: 9px;
    font-size: 14px;
}
.moddle-r-m dd a {
    color: grey;
}
.moddle-r-m dd a:hover {
    color: red;
}
.middle-r-b ul {
    width: 101%;
    height: 100%;
    overflow: hidden;
}
.middle-r-b ul li {
    float: left;
    width: 50px;
    height: 66px;
    font-size: 12px;
    position: relative;
    border-top: 1px solid grey;
    border-right: 1px solid grey;
}
.middle-r-b ul li a {
    width: 24px;
    color: grey;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
}
.middle-r-b a span {
    position: absolute;
    width: 20px;
    height: 30px;
    top: -35px;
    left: -1px;
    background: url("../images/[email protected]") no-repeat 0px -82px; 
}
.middle-r-b ul li a:hover {
    color: red;
}
View Code
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
/*
http://necolas.github.io/normalize.css/
*/
/**
 * 1. Change the default font family in all browsers (opinionated).
 * 2. Correct the line height in all browsers.
 * 3. Prevent adjustments of font size after orientation changes in
 *    IE on Windows Phone and in iOS.
 */

/* Document
   ========================================================================== */

html {
    font-family: sans-serif; /* 1 */
    line-height: 1.15; /* 2 */
    -ms-text-size-adjust: 100%; /* 3 */
    -webkit-text-size-adjust: 100%; /* 3 */
}

/* Sections
   ========================================================================== */

/**
 * Remove the margin in all browsers (opinionated).
 */

body {
    margin: 0;
}

/**
 * Add the correct display in IE 9-.
 */

article,
aside,
footer,
header,
nav,
section {
    display: block;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */

h1 {
    font-size: 2em;
    margin: 0.67em 0;
}

/* Grouping content
   ========================================================================== */

/**
 * Add the correct display in IE 9-.
 * 1. Add the correct display in IE.
 */

figcaption,
figure,
main { /* 1 */
    display: block;
}

/**
 * Add the correct margin in IE 8.
 */

figure {
    margin: 1em 40px;
}

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
    box-sizing: content-box; /* 1 */
    height: 0; /* 1 */
    overflow: visible; /* 2 */
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

pre {
    font-family: monospace, monospace; /* 1 */
    font-size: 1em; /* 2 */
}

/* Text-level semantics
   ========================================================================== */

/**
 * 1. Remove the gray background on active links in IE 10.
 * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
 */

a {
    background-color: transparent; /* 1 */
    -webkit-text-decoration-skip: objects; /* 2 */
}

/**
 * Remove the outline on focused links when they are also active or hovered
 * in all browsers (opinionated).
 */

a:active,
a:hover {
    outline-width: 0;
}

/**
 * 1. Remove the bottom border in Firefox 39-.
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */

abbr[title] {
    border-bottom: none; /* 1 */
    text-decoration: underline; /* 2 */
    text-decoration: underline dotted; /* 2 */
}

/**
 * Prevent the duplicate application of `bolder` by the next rule in Safari 6.
 */

b,
strong {
    font-weight: inherit;
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

b,
strong {
    font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

code,
kbd,
samp {
    font-family: monospace, monospace; /* 1 */
    font-size: 1em; /* 2 */
}

/**
 * Add the correct font style in Android 4.3-.
 */

dfn {
    font-style: italic;
}

/**
 * Add the correct background and color in IE 9-.
 */

mark {
    background-color: #ff0;
    color: #000;
}

/**
 * Add the correct font size in all browsers.
 */

small {
    font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sub {
    bottom: -0.25em;
}

sup {
    top: -0.5em;
}

/* Embedded content
   ========================================================================== */

/**
 * Add the correct display in IE 9-.
 */

audio,
video {
    display: inline-block;
}

/**
 * Add the correct display in iOS 4-7.
 */

audio:not([controls]) {
    display: none;
    height: 0;
}

/**
 * Remove the border on images inside links in IE 10-.
 */

img {
    border-style: none;
}

/**
 * Hide the overflow in IE.
 */

svg:not(:root) {
    overflow: hidden;
}

/* Forms
   ========================================================================== */

/**
 * 1. Change the font styles in all browsers (opinionated).
 * 2. Remove the margin in Firefox and Safari.
 */

button,
input,
optgroup,
select,
textarea {
    font-family: sans-serif; /* 1 */
    font-size: 100%; /* 1 */
    line-height: 1.15; /* 1 */
    margin: 0; /* 2 */
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */

button,
input { /* 1 */
    overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select { /* 1 */
    text-transform: none;
}

/**
 * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
 *    controls in Android 4.
 * 2. Correct the inability to style clickable types in iOS and Safari.
 */

button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
    -webkit-appearance: button; /*