Author:Mr.柳上原
- 付出不亞于任何的努力
- 愿我們所有的努力,都不會被生活辜負
- 不忘初心,方得始終
不要忘記自己當初學前端的目的
......
html部分:
<!doctype html> <!-- 網頁申明:html標準文檔 -->
<html lang='en'> <!-- 網頁框架:英文 -->
<head> <!-- 網頁頭部:網頁定義區域 -->
<meta charset='UTF-8'> <!-- 文字編碼:國際通用 -->
<meta name='Keywords' content='努比亞商城,北京努比亞,努比亞官網'> <!-- 關鍵詞:搜索優化 -->
<meta name='Description' content='努比亞(nubia),新銳智能手機品牌,定位高端市場,立足中國面向全球,以“Be Yourself”為品牌理念。努比亞手機產品擁有諸多單反級攝影功能,被稱為“可以拍星星的手機”。努比亞在業內首創了“全網通”,并通過搭載FiT交互技術的全球首款“無邊框手機”nubia Z9為廣大用戶認可。世界足壇巨星C·羅納爾多任努比亞品牌代言人。'> <!-- 網頁描述:網頁簡介 -->
<meta name='Author' content='Mr.柳上原'> <!-- 網頁開發者:我自己 -->
<title>前端59期html+css結業《努比亞商城》</title> <!-- 網頁標題:可見標題欄 -->
<link rel='shortcut icon' type='images/x-icon' href='./icons/bitbug_favicon.ico'/> <!-- 網頁標題圖標 -->
<link rel='stylesheet' type='text/css' href='./css/base.css'/>
<link rel='stylesheet' type='text/css' href='./css/index.css'/> <!-- 外鏈樣式表:給我的下任看的 -->
<!--
標準鍵盤布局
┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐
│Esc│ │ F1│ F2│ F3│ F4│ │ F5│ F6│ F7│ F8│ │ F9│F10│F11│F12│ │P/S│S L│P/B│ ┌┐ ┌┐ ┌┐
└───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ └┘ └┘ └┘
┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐
│~ `│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ BacSp │ │Ins│Hom│PUp│ │N L│ / │ * │ - │
├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤
│ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│ | \ │ │Del│End│PDn│ │ 7 │ 8 │ 9 │ │
├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ ├───┼───┼───┤ + │
│ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter │ │ 4 │ 5 │ 6 │ │
├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ ├───┼───┼───┼───┤
│ Shift │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│ Shift │ │ ↑ │ │ 1 │ 2 │ 3 │ │
├─────┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤ E││
│ Ctrl│ │Alt │ Space │ Alt│ │ │Ctrl│ │ ← │ ↓ │ → │ │ 0 │ . │←─┘│
└─────┴────┴────┴───────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ └───────┴───┴───┘
// 寫字樓里寫字間,寫字間里程序員;
// 程序人員寫程序,又拿程序換酒錢。
// 酒醒只在網上坐,酒醉還來網下眠;
// 酒醉酒醒日復日,網上網下年復年。
// 但愿老死電腦間,不愿鞠躬老板前;
// 奔馳寶馬貴者趣,公交自行程序員。
// 別人笑我忒瘋癲,我笑自己命太賤;
// 不見滿街漂亮妹,哪個歸得程序員?
-->
<style type='text/css'> /* 內部樣式表:給自己看的,懶得切換css表,做完后會全部注釋掉 */
</style>
</head>
<body>
<!--頂部區-->
<div class='top'>
<div class='top_in'>
<div class='top_left'>
<h1>
<a href='javascript:;' title='努比亞'></a>
</h1>
</div>
<div class='top_right'>
<ul class='top_nav'>
<li>
<a href='javascript:;'>首頁</a>
</li>
<li>
<a href='javascript:;'>商城</a>
</li>
<li>
<a href='javascript:;'>產品</a>
</li>
<li>
<a href='javascript:;'>應用</a>
</li>
<li>
<a href='javascript:;'>服務</a>
</li>
<li>
<a href='javascript:;'>體驗店</a>
</li>
<li>
<a href='javascript:;'>社區</a>
</li>
</ul>
<ul class='top_login'>
<li>
<a href='javascript:;'>登陸</a>
</li>
<li>
<a href='javascript:;'>注冊</a>
</li>
</ul>
</div>
</div>
</div>
<!--廣告區-->
<div class='banner'>
<div class='nav_out'>
<div class='nav'>
<ul>
<li>
<a href='javascript:;'>
<img src='./images/nav-phone1.png' alt='新款'/>
</a>
<p>z11S mini <span style='color:red;'>新款</span></p>
</li>
<li>
<a href='javascript:;'>
<img src='./images/nav-phone2.png' alt='新款'/>
<p>z11</p>
</a>
</li>
<li>
<a href='javascript:;'>
<img src='./images/nav-phone3.png' alt='新款'/>
<p>z11 Max</p>
</a>
</li>
<li>
<a href='javascript:;'>
<img src='./images/nav-phone4.png' alt='新款'/>
<p>z11 mini</p>
</a>
</li>
<li>
<a href='javascript:;'>
<img src='./images/nav-phone5.png' alt='新款'/>
<p>N1</p>
</a>
</li>
<li>
<a href='javascript:;'>
<img src='./images/nav-phone6.png' alt='新款'/>
<p>布拉格S</p>
</a>
</li>
<li>
<a href='javascript:;'>
<img src='./images/nav-phone7.png' alt='新款'/>
<p>my 布拉格</p>
</a>
</li>
</ul>
</div>
</div>
<div class='figure'>
<img src='./images/banner.jpg' alt='新款'/>
<ol>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ol>
</div>
<div class='video'>
<ul>
<li>
<img src='./images/video1.jpg' alt='新款'/>
<div class='video_info'>
<img src='./images/nb-pro-video-ico-s.png' alt='新款'/>
<h3>z11 黑金版</h3>
<p>產品視頻</p>
</div>
</li>
<li>
<img src='./images/video2.jpg' alt='新款'/>
<div class='video_info'>
<img src='./images/nb-pro-video-ico-s.png' alt='新款'/>
<h3>z11 黑金版</h3>
<p>產品視頻</p>
</div>
</li>
<li>
<img src='./images/video3.jpg' alt='新款'/>
<div class='video_info'>
<img src='./images/nb-pro-video-ico-s.png' alt='新款'/>
<h3>z11 黑金版</h3>
<p>產品視頻</p>
</div>
</li>
</ul>
</div>
</div>
<!--內容去-->
<div class='content'>
<dl>
<dt>
<h3>最新產品</h3>
<p>查看全部手機»</p>
</dt>
<dd>
<ul class='content_phone'>
<li>
<img src='./images/con-phone1.jpg' alt='新款'/>
<div class='phone_des'>
<h4>Z11極光藍</h4>
<p>激光藍</p>
<span>一探究竟</span>
</div>
</li>
<li>
<img class='img_scale' src='./images/con-phone2.jpg' alt='新款'/>
<div class='phone_des'>
<h4>nobia z11 miniS</h4>
<p>手機攝影專家</p>
<span>一探究竟</span>
</div>
</li>
<li>
<img src='./images/con-phone3.jpg' alt='新款'/>
<div class='phone_des'>
<h4>nobia z11咖啡金</h4>
<p>無邊框旗艦手機</p>
<span>一探究竟</span>
</div>
</li>
<li>
<img class='img_scale' src='./images/con-phone4.jpg' alt='新款'/>
<div class='phone_des'>
<h4>nobia z11 Max</h4>
<p>大不同</p>
</div>
</li>
<li>
<img class='img_scale' src='./images/con-phone5.jpg' alt='新款'/>
<div class='phone_des'>
<h4>nobia z11 mini</h4>
<p>小世界大精彩</p>
</div>
</li>
</ul>
</dd>
<dt>
<h3>精選配件</h3>
<p>查看全部配件»</p>
</dt>
<dd>
<ul class='content_product'>
<li>
<img src='./images/accessories1.jpg' alt='新款'/>
<p>努比亞快充移動電源</p>
</li>
<li>
<img src='./images/accessories2.jpg' alt='新款'/>
<p>努比亞圓鐵耳機</p>
</li>
<li>
<img src='./images/accessories3.jpg' alt='新款'/>
<p>努比亞快炫美自拍桿</p>
</li>
<li>
<img src='./images/accessories4.jpg' alt='新款'/>
<p>nubia攝影三腳架</p>
</li>
</ul>
</dd>
</dl>
</div>
<!--底部區-->
<div class='footer'>
<div class='footer_in'>
<div class='footer_top'>
<img src='./images/nb-pro-ft-logo-x2.jpg' alt='新款'/>
> 全部機型
<div class='footer_content'>
<dl>
<dt>Z系列</dt>
<dd>
<a href='javascript:;'>nubia Z11</a>
</dd>
<dd>
<a href='javascript:;'>nubia Z11 Max</a>
</dd>
<dd>
<a href='javascript:;'>nubia Z11 mini</a>
</dd>
</dl>
<dl>
<dt>M系列</dt>
<dd>
<a href='javascript:;'>nubia 布拉格S</a>
</dd>
<dd>
<a href='javascript:;'>nubia</a>
</dd>
</dl>
<dl>
<dt>配件</dt>
<dd>
<a href='javascript:;'>保護殼</a>
</dd>
<dd>
<a href='javascript:;'>皮套</a>
</dd>
<dd>
<a href='javascript:;'>貼膜</a>
</dd>
<dd>
<a href='javascript:;'>耳機</a>
</dd>
<dd>
<a href='javascript:;'>數據線/充電器</a>
</dd>
<dd>
<a href='javascript:;'>周邊產品</a>
</dd>
</dl>
</div>
</div>
<div class='footer_bottom'>
<ul class='footer_copyright'>
<li>
<a href='javascript:;'>關于我們</a> |
</li>
<li>
<a href='javascript:;'>聯系我們</a> |
</li>
<li>
<a href='javascript:;'>新聞中心</a> |
</li>
<li>
<a href='javascript:;'>加入我們</a> |
</li>
<li>
<a href='javascript:;'>合作注冊</a>|
</li>
<li>
<a href='javascript:;'>公益</a> |
</li>
<li>
<a href='javascript:;'>以舊換新</a> |
</li>
<li>
<a href='javascript:;'>問題反饋</a> |
</li>
<li>
<a href='javascript:;'>簡體中文</a> |
</li>
</ul>
<ul class='footer_social'>
<li>
<a href='javascript:;'></a>
</li>
<li>
<a href='javascript:;'></a>
</li>
<li>
<a href='javascript:;'></a>
</li>
</ul>
</div>
</div>
</div>
</body>
</html>
css部分1,base.css:
@charset "utf-8";
/* 清空默認樣式 */
html{
color:#000;
background:#FFF;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{
margin:0;
padding:0;
}
table{
border-collapse:collapse;
border-spacing:0;
}
fieldset,img{
border:0;
}
address,caption,cite,code,dfn,em,strong,th,var{
font-style:normal;
font-weight:normal;
}
ol,ul{
list-style:none;
}
caption,th{
text-align:left;
}
h1,h2,h3,h4,h5,h6{
font-size:100%;
font-weight:normal;
}
q:before,q:after{
content:'';
}
abbr,acronym{
border:0;
font-variant:normal;
}
sup{
vertical-align:text-top;
}
sub{
vertical-align:text-bottom;
}
input,textarea,select{
font-family:inherit;
font-size:inherit;
font-weight:inherit;
*font-size:100%;
}
legend{
color:#000;
}
a{
text-decoration:none;
color:#999;
}
/*設置全局樣式*/
body{
font-family: "微軟雅黑";
font-size: 12px;
color: #999;
background-color: #f5f5f5;
}
css部分2,index.css:
@charset "utf-8";
/* 頭部開始 */
.top{
height:60px;
background-color:black;
}
.top .top_in{
width:1200px;
height:100%;
margin:0px auto;
}
.top .top_left{
float:left;
height:100%;
width:190px;
overflow:hidden;
}
.top .top_left > h1{
width:100%;
height:100%;
}
.top .top_left > h1 a{
display:inline-block;
width:100%;
height:100%;
background:url('../images/nubia-logo.png');
}
.top .top_right{
float:right;
height:100%;
width:740px;
}
.top .top_nav{
float:left;
width:550px;
height:100%;
}
.top .top_nav > li{
float:left;
}
.top .top_nav > li > a{
font-size:16px;
font-weight:bold;
color:#ccc;
text-align:center;
line-height:60px;
margin-left:40px;
}
.top ul > li > a:hover{
color:#e82707;
}
.top .top_login{
float:right;
width:150px;
height:100%;
}
.top .top_login > li{
float:right;
text-align:center;
line-height:60px;
margin-left:10px;
}
.top .top_login > li:nth-child(3){
width:30px;
height:30px;
background:url('../images/nubia-syb-all.png');
margin-top:15px;
}
.top .top_login > li > a{
font-size:16px;
font-weight:bold;
color:#ccc;
}
/* 廣告區 */
.banner{
height:860px;
}
.banner .nav_out{
width:100%;
height:121px;
position:absolute;
background-color:#fff;
z-index:998;
}
.banner .nav{
height:121px;
width:1200px;
margin:0px auto;
}
.banner .nav > ul{
width:100%;
height:100%;
margin:0px auto;
padding-left:75px;
padding-right:75px;
box-sizing:border-box;
}
.banner .nav > ul > li{
float:left;
width:150px;
height:100%;
text-align:center;
}
.banner .nav > ul > li img{
width:120px;
height:80px;
margin-top:15px;
}
.banner .nav > ul > li:hover{
border-bottom:2px solid red;
box-sizing:border-box;
}
.banner .figure{
height:600px;
width:100%;
background-color:#fff;
text-align:center;
overflow:hidden;
position:relative;
}
.banner .figure > img{
height:100%;
margin:0px -100%;
}
.banner .figure > ol{
width:150px;
height:20px;
position:absolute;
left:50%;
margin-left:-75px;
bottom:10px;
}
.banner .figure > ol > li{
border-radius:50%;
float:left;
width:8px;
height:8px;
background-color:#cccccc;
margin-left:15px;
border:2px solid transparent;
transition:border 1s;
}
.banner .figure > ol > li:hover{
border:2px solid red;
background-color:transparent;
transform:scale(1.2,1.2);
}
.banner .video{
width:1200px;
height:250px;
margin:0 auto;
margin-top:10px;
background-color:#ff6247;
}
.banner .video > ul{
width:100%;
height:100%;
background-color:forestgreen;
}
.banner .video > ul > li{
width:396px;
height:250px;
float:left;
margin-right:3px;
text-align:center;
overflow:hidden;
position:relative;
background-color:black;
}
.banner .video > ul > li > img{
height:100%;
margin:0 -100%;
}
.banner .video .video_info{
width:100%;
height:155px;
position:absolute;
bottom:0;
opacity:0;
transition:opacity 1s;
}
.banner .video .video_info > h3{
font-size:16px;
line-height:40px;
color:white;
}
.banner .video .video_info > p{
color:white;
}
.banner .video > ul > li:hover .video_info{
opacity:1;
}
.banner .video > ul > li:hover >img{
opacity:0.5;
}
.banner .video > ul > li:hover .video_info >img{
animation:sport 2s .5s ease-in-out infinite;
}
@keyframes sport{
20%{transform: scale(.8);}
40%{transform: scale(1.2);}
60%{transform: scale(.9);}
80%{transform: scale(1);}
100%{transform: scale(1);}
}
/* 內容區 */
.content{
height:1883px;
}
.content > dl{
width:1200px;
height:100%;
margin:0 auto;
overflow:hidden;
}
.content > dl > dt{
text-align:center;
margin-top:40px;
margin-bottom:30px;
}
.content > dl > dt > h3{
font-size:35px;
color:#333;
margin-bottom:20px;
}
.content > dl > dt > p{
color:#e8304e;
margin-top:20px;
}
.content .content_phone{
width:1200px;
height:1200px;
}
.content .content_phone > li{
float:left;
background-color:#fff;
position:relative;
overflow:hidden;
}
.content .content_phone > li:nth-child(1){
width:1200px;
height:395px;
margin-bottom:10px;
}
.content .content_phone > li:nth-child(2){
width:395px;
height:795px;
margin-right:10px;
}
.content .content_phone > li:nth-child(3){
width:795px;
height:390px;
margin-bottom:10px;
}
.content .content_phone > li:nth-child(4){
width:390px;
height:395px;
margin-right:10px;
}
.content .content_phone > li:nth-child(5){
width:395px;
height:395px;
}
.content .content_phone > li > img{
width:100%;
transition:all 1s;
}
.content .content_phone > li:nth-child(1) > img{
margin-top:60px;
}
.content .content_phone .phone_des{
width:200px;
position:absolute;
left:50%;
margin-left:-100px;
bottom:10px;
text-align:center;
}
.content .content_phone .phone_des > h4{
font-size:20px;
color:#000;
}
.content .content_phone .phone_des > p{
font-size:15px;
margin-bottom:10px;
color:#999999;
}
.content .content_phone .phone_des > span{
display:inline-block;
width:108px;
height:32px;
text-align:center;
line-height:32px;
border:1px solid #ccc;
border-radius:10px;
color:#000;
}
.content .content_phone > li:nth-child(1) .phone_des{
left:0%;
margin-left:800px;
bottom:150px ;
}
.content .content_phone > li:nth-child(1) img{
margin-left:-100px;
}
.content .content_phone > li:nth-child(1):hover img {
margin-left:0;
}
.content .content_phone > li:nth-child(3) img{
margin-left:100px;
}
.content .content_phone > li:nth-child(3):hover img {
margin-left:0;
}
.content .content_phone > li:hover .img_scale{
transform:scale(1.2,1.2);
}
.content .content_product{
width:1200px;
height:300px;
display:flex;
justify-content:space-between;
}
.content .content_product > li{
width:295px;
height:300px;
float:left;
background-color:white;
margin-left:4px;
overflow:hidden;
}
.content .content_product > li > img{
width:100%;
transition:all 1s;
}
.content .content_product > li > p{
margin-top:20px;
text-align:center;
}
.content .content_product > li:hover img{
transform:scale(1.2,1.2);
}
/* 底部區 */
.footer{
height:396px;
}
.footer .footer_top{
width:1200px;
border-top:1px solid #ccc;
margin:0 auto;
}
.footer .footer_content{
margin-top:20px;
padding-left:100px;
overflow:hidden;
}
.footer .footer_content > dl{
float:left;
width:200px;
}
.footer .footer_content > dl > dt{
color:#000;
font-size:14px;
line-height:30px;
}
.footer .footer_content > dl > dd{
line-height:20px;
}
.footer .footer_content > dl > dd a:hover{
color:red;
}
.footer .footer_copyright{
list-style:none;
float:left;
margin-top:10px;
}
.footer .footer_copyright > li{
float:left;
padding:10px;
font-size:10px;
margin-left:10px;
}
.footer .footer_copyright > li:hover a{
color:#000;
}
.footer .footer_social{
float:left;
margin-left:50px;
list-style:none;
margin-top:10px;
font-size:20px;
}
.footer .footer_social > li{
float:left;
width:30px;
height:30px;
margin-right:10px;
}
.footer .footer_social > li a{
display:inline-block;
width:30px;
height:30px;
background:url('../images/nubia-syb-all.png');
}
.footer .footer_social > li:nth-child(1) a{
background-position:-246px 0;
}
.footer .footer_social > li:nth-child(2) a{
background-position:-186px 0;
}
.footer .footer_social > li:nth-child(3) a{
background-position:-126px 0;
}
.footer .footer_social > li:nth-child(4) a{
background-position:-156px 0;
}
.footer .footer_info{
float:left;
font-size:10px;
line-height:30px;
}
.footer .footer_bottom{
width:740px;
margin:0px auto;
}