HTML連載87-完善內容區域

来源:https://www.cnblogs.com/ruigege0000/archive/2020/05/10/12861416.html
-Advertisement-
Play Games

一、先上成型之後的圖 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="CSS/base.css"> <link rel=" ...


一、先上成型之後的圖

 

 

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <title>Title</title>

    <link rel="stylesheet" href="CSS/base.css">

    <link rel="stylesheet" href="CSS/index.css">

</head>

<body>

<!--頂部區域-->

<div class="top">

    <div class="top_in">

        <div class="top_left">

            <h1><a href="#" title="努比亞"></a></h1><!--a標簽裡面的title屬性,就是用於當滑鼠放到a標簽上面的時候會顯示的文字-->

        </div>

        <div class="top_right">

            <ul class="top_nav">

                <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>

            <ul class="top_login">

                <!--這裡有一個註意點,我們想要使用的右浮動,所以三個li標簽應該倒敘寫,因為先寫的先浮動哦-->

                <li><a href="#">註冊</a></li>

                <li><a href="#">登錄</a></li>

                <li><a href="#"></a></li>

            </ul>

        </div>

    </div>

</div>

<!--廣告區域-->

<div class="banner">

    <div class="nav_out">

        <div class="nav">

            <ul>

                <li><a href="#"><img src="image/nav-phone1.png" alt=""></a></li>

                <li><a href="#"><img src="image/nav-phone1.png" alt=""></a></li>

                <li><a href="#"><img src="image/nav-phone1.png" alt=""></a></li>

                <li><a href="#"><img src="image/nav-phone1.png" alt=""></a></li>

                <li><a href="#"><img src="image/nav-phone1.png" alt=""></a></li>

                <li><a href="#"><img src="image/nav-phone1.png" alt=""></a></li>

                <li><a href="#"><img src="image/nav-phone1.png" alt=""></a></li>

            </ul>

        </div>

    </div>

    <div class="figure">

        <img src="image/banner.png" alt="">

        <ol>

            <li></li>

            <li></li>

            <li></li>

            <li></li>

            <li></li>

        </ol>

    </div>

    <div class="video">

        <ul>

            <li>

                <img src="image/video1.png" alt="">

                <div class="video_info">

                    <img src="" alt="">

                    <h3>Z11黑金版本</h3>

                    <p>產品視頻</p>

                </div>

            </li>

            <li><img src="image/video2.png" alt=""></li>

            <li><img src="image/video3.png" alt=""></li>

        </ul>

    </div>

</div>

<!--內容區域-->

<div class="content">

    <dl>

        <dt>

            <h3>最新產品</h3>

            <p>查看全部 &gt;</p>

        </dt>

        <dd>

            <ul class="content_phone">

                <li></li>

                <li></li>

                <li></li>

                <li></li>

                <li></li>

            </ul>

        </dd>

        <dt>

            <h3>最新產品</h3>

            <p>查看全部 &gt;</p>

        </dt>

        <dd>

            <ul class="content_accessories">

                <li></li>

                <li></li>

                <li></li>

                <li></li>

                <li></li>

            </ul>

        </dd>

    </dl>

</div>

<!--底部區域-->

<div class="footer"></div>

</body>

</html>

 

/*頂部區域*/

.top{

    height:60px;

    width:100%;/*也就是和父元素一樣寬,這裡使用百分比的形式,使得網頁擴大減小都不會變形*/

    background-color: black;

​

}

.top .top_in{

    width: 1200px;

    margin:0 auto;

    height:100%;

    /*background-color: yellow;*/

}

.top  .top_left{

    float:left;

    height:100%;

    width:190px;

    /*background-color: pink;*/

}

.top .top_left>h1{

    width: 100%;

    height: 100%;

​

}

.top .top_left>h1>a{

    display: inline-block;

    width: 100%;

    height: 100%;

    background:url("../image/nubia_logo.png");

    background-size: 190px 60px;/*設置圖片大小正好適配div塊的大小*/

}

.top .top_right{

    float:right;

    height: 100%;

    width: 800px;

    /*background-color: pink;*/

}

.top .top_nav{

    float:left;

    width:550px;

    height: 100%;

    /*background-color: skyblue;*/

​

​

}

.top .top_nav>li{

    float:left;

    list-style: none;

}

.top .top_nav>li>a{

    font-size:25px;

    font-weight: bold;/*給文字加粗*/

    line-height:60px;

    color:white;/*文字的顏色,直接是color*/

    margin-left:20px;/*這是給文字添加空隙*/

    text-decoration:none;/*去掉文字的下劃線*/

}

/*.top .top_nav>li>a:hover{!*移動滑鼠上去變化顏色*!*/

    /*color:#e82c07;*/

/*}*/

.top .top_login{

    float:right;

    width: 150px;

    height: 100%;

    /*background-color: skyblue;*/

}

.top .top_login>li{

    list-style: none;

    float:right;

    margin-right:10px;

}

.top .top_login>li>a{

    font-size:20px;

    font-weight:bold;

    line-height:60px;

    color:white;

​

    text-decoration:none;

}

.top ul>li>a:hover{/*移動滑鼠上去變化顏色*/

    color:#e82c07;

    /*這裡我們使用.top ,top_login>li>a:hover而使用了ul來替代top_login這個可以說是代碼的重構,我們希望

    li標簽里的文字滑鼠懸浮都變色,這樣我們把父層級一改,可以省略代碼,在後續編程中這些都是隱形的小技巧

     */

}

.top .top_login>li:nth-child(3){

    width: 30px;

    height: 37px;

    background:url("../image/nubia_person.png");

    margin-top:10px;

}

​

/*廣告區域*/

.banner{

    height: 800px;

    width: 100%;

    /*background-color: green;*/

}

/*內容區域*/

.content{

    height: 1883px;

    width: 100%;

    /*background-color: blue;*/

}

.banner .nav_out{

    background-color: white;

    height: 157px;

    width: 100%;

}

​

.banner .nav{

    width: 1200px;

    height: 157px;

    /*margin:0 auto;*//*這裡我們想要居中這個模塊,但是我們把定位流變成了絕對定位,所以就不管用了*/

    /*background:pink;*/

    position:absolute;/*只所所以改成絕對定位流,就是想要讓這個盒子脫標,這樣就可以讓nav這個盒子懸浮在下個盒子上面*/

    left:50%;/*通過這種方式來進行居中盒子,靠左邊的一邊,然後利用一半的寬度-600px進行回退*/

    margin-left:-600px;

    background:white;

}

.banner .nav>ul{

    width:100%;

    height:100%;

    /*background:yellow;*/

    padding-left: 75px;

    padding-right:75px;

    box-sizing:border-box;/*上面使用了內邊距,這裡是為了不讓大盒子變形*/

}

.banner .nav>ul>li{

    width: 150px;

    height:100%;

    /*background:purple;*/

    float:left;/*之所以變成浮動流,是因為li會獨占一行,這樣會占有七行,浮動流可以使它水平排版了*/

    /*border:1px solid black;*/

    box-sizing:border-box;/*為了就是不用因為邊框而使得盒子變大變小*/

    list-style: none;

}

.banner .nav>ul>li:hover{

    border-bottom:3px red solid;

    box-sizing:border-box;

}

.banner .nac>ul>li image{

    width:150px;

    height:157px;

}

.banner .figure{

    width: 100%;

    height: 600px;

    /*background:red;*/

    overflow:hidden:/*隱藏圖片的滾動條*/

    position:relative;

}

.banner .figure>img{

    /*margin:0 auto;這個語法沒有效果,對其父元素使用text-align:center;也是沒有用的,因為圖片太大了,解決方式如下:*/

    /*如果圖片的寬度大於了父元素的寬度,不可能使用margin:0 auto;或者text-align:center;來使圖片居中*/

    /*如果圖片的寬度大於父元素的寬度,可以使用定位流,來使得圖片居中,但是定位流的弊端也是比較明顯*/

    /*弊端:1.需要寫三行代碼;2.必須知道圖片的寬度;*/

    /*還有一種方法:margin:0 -100%; 註意點:父元素必須設置text-align:center;*/

    width:1200px;

    position:absolute;

    margin-left:540px;

    /*如果圖片太長而多了一個滾動條,那麼可以在父元素的CSS代碼中添加overflow屬性*/

}

.banner .figure>ol{

    width: 150px;

    height: 20px;

    /*background:red;*/

    position:absolute;/*子絕父相*/

    left:50%;

    margin-left:-75px;

    bottom:300px

}

.banner .figure>ol>li{

    float:left;

    width: 8px;

    height: 8px;

    background:red;

    margin-left:15px;

    border-radius:50%;

    border:2px solid transparent;/*transparent代表的是透明色,當然你也可以用rgba來顯示透明色*/

    transition: all 1s;

    list-style: none;

 }

.banner .figure>ol>li:hover{

    border:2px solid black;

    background: transparent;

    transform:scale(2,2);/*放大兩倍*/

}

.banner .video{

    width: 1200px;

    height: 250px;

    margin: 0 auto;

    margin-top: 10px;

    /*background:skyblue;*/

}

.banner .video>ul{

    width: 100%;

    height: 100%;

    /*background:yellow;*/

    /*display:flex;!*這是伸縮佈局*!*/

    /*justify-content: space-between;!*這個語句代表著所有的li標簽能夠水平鋪開*!*/

​

}

.banner .video>ul>li{

    width: 396px;

    height: 250px;

    background:black;

    float:left;/*換成左漂浮,迅速就占領了黃色的全域,這是因為一個挨著一個排版了,原來是每一行進行排版*/

    list-style:none;

    margin-right:4px;/*這一行可以換成伸縮佈局來進行代替,方法如上一個標簽樣式*/

    overflow:hidden;

    position:relative;

​

}

.banner .video>ul>li>img{

    width: 396px;

    height: 250px;

}

.banner .video .video_info{

    position:absolute;

    width: 100%;

    height: 155px;

    bottom:0;

    opacity:1;/*作用:設置元素的透明度   特點:子元素也是跟著透明*/

​

​

}

.banner .video .video_info>h3{

    font-size: 16px;

    color:black;

    line-height:40px;

    text-align: center;

​

}

.banner .video .video_info>p{

    color:black;

​

}

.banner .video >ul>li:hover  .video_info{

    opacity:0.5;

}

.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(0.8);

    }

    40% {

        transform:scale(1.2);

    }

    60% {

        transform:scale(0.9);

    }

    80% {

        transform:scale(1);

    }

    100% {

        transform:scale(1);

    }

}

.content>dl{

    width: 1200px;

    height: 100%;

    background:green;

    margin:0 auto;

}

.content>dl>dt{

    text-align: center;

    margin-top:40px;

    margin-bottom:30px;

​

}

.content>dl>dt>h3{

    font-size:35px;

    color:black;

}

.content>dl>dt>p{

    color:#e8340e;

}

.content .content_phone{

    width: 1200px;

    height: 1200px;

    background:yellow;

}

.content .content_accessories{

    width: 1200px;

    height: 1200px;

    background:skyblue;

    display:flex;

    justify-content: space-between;/*這個屬性就是自適應盒子*/

}

.content .content_phone>li{

    float:left;

}

.content .content_phone>li:nth-child(1){

    width: 1200px;

    height: 395px;

    background:pink;

    margin-bottom:10px;

}

.content .content_phone>li:nth-child(2){

    width: 395px;

    height: 795px;

    background:purple;

    margin-right:10px;

}

.content .content_phone>li:nth-child(3){

    width: 795px;

    height: 390px;

    background:palegreen;

    margin-bottom:10px;

}

.content .content_phone>li:nth-child(4){

    width: 390px;

    height: 395px;

    background:gold;

    margin-right:10px;

}

.content .content_phone>li:nth-child(5){

    width: 395px;

    height: 395px;

    background:tomato;

}

.content .content_accessories>li{

    float:left;

    width: 295px;

    height: 300px;

    background: saddlebrown ;

    margin-right: 5px;

}

/*底部區域*/

.footer{

​

}

 

二、源碼:

1.項目:Nubia

地址:

https://github.com/ruigege66/HTML_learning/tree/master/Nubia

2.CSDN:https://blog.csdn.net/weixin_44630050

3.博客園:https://www.cnblogs.com/ruigege0000/

4.歡迎關註微信公眾號:傅里葉變換,個人賬號,僅用於技術交流,後臺回覆“禮包”獲取Java大數據學習視頻禮包

 

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 十二、mysql主從複製 1、主從複製原理 1.主從複製的前提: 1.1兩台mysql實例(多台物理機,或者多實例) 1.2主庫要開啟二進位日誌 1.3主庫要提供複製相關用戶,replication slave,一個比較特殊的許可權。 1.4從庫需要將和主庫相差的數據,進行追加 一般情況下可以人為備份 ...
  • DDL語言庫與表的管理(創建、修改、刪除)、一些常見的數據類型(整形、浮點|定點、日期,字元) ...
  • 創建資料庫 -- Firsr way CREATE DATABASE database_name; -- Second way CREATE SCHEMA database_name; 2.創建表 CREATE TABLE birds( bird_id INT AUTO_INCREMENT PRIM ...
  • 思考: 大家可以思考一下下麵sql語句寫的有沒有問題? select jg.id as goodsId,jm.name,... from jdy_merchant jm left outer join jdy_express_template jet on jet.id = jg.freight l ...
  • MongoDB Manual (Version 4.2) Replication MongoDB中的副本集是一組維護相同數據集合的 mongod進程。副本集提供了冗餘和高可用性,並且這是所有生產部署的基礎。本節介紹MongoDB中的複製以及副本集的組件和體繫結構,並提供副本集常見任務的教程。 No1 ...
  • 摸清數據產生量如何,如果是1鈔鐘1條記錄,則一臺車一天就有86400條記錄,則建議如下: 1、每臺車使用單獨的表,程式內部使用CreateTable,動態創建表,銷毀表。這樣車與車之間不會產生聯繫。 前提:系統管理的車應該不會經常變來變去,沒有很多關聯查詢出多臺車軌跡的需求。 2、建立當前表、歷史表 ...
  • 表結構 student(StuId,StuName,StuAge,StuSex) 學生表 teacher(TId,Tname) 教師表 course(CId,Cname,C_TId) 課程表 sc(SId,S_CId,Score) 成績表 問題七:查詢學過“葉平”老師所教的所有課的同學的學號、姓名 ...
  • val rdd3 = sc.parallelize(List("12","23","345","4567"),2) rdd3.aggregate("")((x,y) => math.max(x.length, y.length).toString, (x,y) => x + y) 兩個分區先計算出字 ...
一周排行
    -Advertisement-
    Play Games
  • 前言 在我們開發過程中基本上不可或缺的用到一些敏感機密數據,比如SQL伺服器的連接串或者是OAuth2的Secret等,這些敏感數據在代碼中是不太安全的,我們不應該在源代碼中存儲密碼和其他的敏感數據,一種推薦的方式是通過Asp.Net Core的機密管理器。 機密管理器 在 ASP.NET Core ...
  • 新改進提供的Taurus Rpc 功能,可以簡化微服務間的調用,同時可以不用再手動輸出模塊名稱,或調用路徑,包括負載均衡,這一切,由框架實現並提供了。新的Taurus Rpc 功能,將使得服務間的調用,更加輕鬆、簡約、高效。 ...
  • 順序棧的介面程式 目錄順序棧的介面程式頭文件創建順序棧入棧出棧利用棧將10進位轉16進位數驗證 頭文件 #include <stdio.h> #include <stdbool.h> #include <stdlib.h> 創建順序棧 // 指的是順序棧中的元素的數據類型,用戶可以根據需要進行修改 ...
  • 前言 整理這個官方翻譯的系列,原因是網上大部分的 tomcat 版本比較舊,此版本為 v11 最新的版本。 開源項目 從零手寫實現 tomcat minicat 別稱【嗅虎】心有猛虎,輕嗅薔薇。 系列文章 web server apache tomcat11-01-官方文檔入門介紹 web serv ...
  • C總結與剖析:關鍵字篇 -- <<C語言深度解剖>> 目錄C總結與剖析:關鍵字篇 -- <<C語言深度解剖>>程式的本質:二進位文件變數1.變數:記憶體上的某個位置開闢的空間2.變數的初始化3.為什麼要有變數4.局部變數與全局變數5.變數的大小由類型決定6.任何一個變數,記憶體賦值都是從低地址開始往高地 ...
  • 如果讓你來做一個有狀態流式應用的故障恢復,你會如何來做呢? 單機和多機會遇到什麼不同的問題? Flink Checkpoint 是做什麼用的?原理是什麼? ...
  • C++ 多級繼承 多級繼承是一種面向對象編程(OOP)特性,允許一個類從多個基類繼承屬性和方法。它使代碼更易於組織和維護,並促進代碼重用。 多級繼承的語法 在 C++ 中,使用 : 符號來指定繼承關係。多級繼承的語法如下: class DerivedClass : public BaseClass1 ...
  • 前言 什麼是SpringCloud? Spring Cloud 是一系列框架的有序集合,它利用 Spring Boot 的開發便利性簡化了分散式系統的開發,比如服務註冊、服務發現、網關、路由、鏈路追蹤等。Spring Cloud 並不是重覆造輪子,而是將市面上開發得比較好的模塊集成進去,進行封裝,從 ...
  • class_template 類模板和函數模板的定義和使用類似,我們已經進行了介紹。有時,有兩個或多個類,其功能是相同的,僅僅是數據類型不同。類模板用於實現類所需數據的類型參數化 template<class NameType, class AgeType> class Person { publi ...
  • 目錄system v IPC簡介共用記憶體需要用到的函數介面shmget函數--獲取對象IDshmat函數--獲得映射空間shmctl函數--釋放資源共用記憶體實現思路註意 system v IPC簡介 消息隊列、共用記憶體和信號量統稱為system v IPC(進程間通信機制),V是羅馬數字5,是UNI ...