本文主要和大家介紹了CSS+Html設計網站導航的具體步驟與相關操作技巧,需要的朋友可以參考下,希望能協助到大家。
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="CSS/style.css"/> <title>網站案例分析</title> </head> <body><!--=============導航部分================--> <ul class="nav"> <li class="logo">LOGO</li> <li class="xuanzhong">網站首頁</li> <li>關於我們</li> <li>新聞中心</li> <li>產品展示</li> <li>客戶案例</li> <li>給我留言</li> <li>人才招聘</li> <li>聯絡我們</li> </ul> </body></html>======================================================================@charset "utf-8";body{margin: 0 auto;padding: 0;}.nav{width: 1240px;height: 133px;margin: 0 auto;font-family: "微軟雅黑";/*字型型號*/}.nav li{list-style: none;/*去掉前面的所有點*/float: left;/*讓導航內容由豎排變成橫排*/width: 107px;height: 100%;/*和父節點一樣高*/line-height: 133px;/*行高就是行與行之間的距離*/text-align: center;/*文字左右置中*/font-size: 18px;/*字型大小*/color: #333333;/*字型顏色*/}.nav .logo{width: 363px;height: 100%;font-size: 64px;/*字型大小*/color: #0c53ad;/*字型顏色*/font-family: "微軟雅黑";/*字型型號*/}.nav .xuanzhong{background-color: #1040a8;color: #ffffff;}