1、製做頂部區域css
提示一個快捷鍵:(1)ctrl+/html
/*.top .top_login>li{*/
/*list-style: none;*/
/*float:right;*/
/*}*/
(2)ctrl+shift+/git
/*.top .top_login>li{
list-style: none;
float:right;
}*/
這兩種註釋的快捷鍵,一個每行都註釋,一個總體註釋。github
2、開始設計努比亞界面的頭部信息編程
<!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> <!--內容區域--> <div class="content"></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; } /*底部區域*/ .footer{ }
3、源碼:微信
D194_CSSWritingFormat.html學習
項目:Nubia大數據
地址:ui
https://github.com/ruigege66/HTML_learning/blob/master/D194_CSSWritingFormat.htmlurl
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大數據學習視頻禮包