Html + Css3 製作酷炫的導覽列

來源:互聯網
上載者:User

標籤:導覽列   html   css3   style   菜單   

主要亮點:

  1 ul 水平顯示  2 li 去掉圓點  3 li中字型水平、豎直置中  4 li控制邊框樣式  5 使用html + css3 漸層畫圖 製作背景圖片  6 更改顏色透明度  7 DIV製作邊框陰影先看:







實現代碼:
<!doctype html><html lang="en"> <head>  <meta charset="UTF-8"> <!----編碼----->  <meta name="Generator" content="EditPlus®">  <meta name="Author" content="黃濤">  <meta name="Keywords" content="關鍵字,搜尋引擎">  <meta name="Description" content="描述語言">  <title>案例</title><style type="text/css">*{ margin:0;padding:0; }body{background:url("images/bg_title.jpg") repeat-x,url("images/bg.jpg");}#Logo{width:895px;height:45px;/*margin:上下 左右*/margin:50px auto;border-radius:10px;/*html + css3 漸層畫圖 */        background-image:-webkit-linear-gradient(rgba(41,41,41,0.75) 0% ,rgba(54,54,54,0.72) 50%,rgba(24,23,23,0.94) 51%);box-shadow:1px 1px 33px #fff;/*設計陰影的*/}#Logo ul li{width:127px; height:45px;list-style:none;/*去掉圓點*/float:left;/*水平顯示*/color:white;/* #fff */font-size:18px;font-family:"微軟雅黑";text-align:center;line-height:45px;/* 行高跟 高度一致時,豎直置中*/border-right:1px solid #000;/*右邊框*/}#Logo ul li a{color:white;/* #fff */font-size:18px;font-family:"微軟雅黑";text-decoration:none;}#Logo ul li:hover{background:rgba(10,5,5,0.45);}#Logo ul li.first:hover{border-radius:10px 0px 0px 10px;/*左上 左下 圓弧顯示 */}#Logo ul li.last:hover{border-radius:0px 10px 10px 0px;/*右上 右下 圓弧顯示 */}#Logo ul li ul li {border:none;border-top:1px solid #989898;background:rgba(10,5,5,0.45);/*顏色透明度 */border-radius:10px;}#Logo ul li ul{display:none;/*不顯示*/}#Logo ul li ul li:hover{background:rgba(10,5,5,0.8);/*顏色透明度 */border-radius:10px;}#Logo ul li:hover ul{display:block;-webkit-animation:roll 1s ease;/*roll 旋轉名稱,1s旋轉效果 */}@-webkit-keyframes roll /*roll旋轉名稱與上面一致*/{0% {-webkit-transform:rotate(0deg);}100% {-webkit-transform:rotate(360deg);}}</style> </head> <body><div id="Logo"><ul><li class="first"> <a href="#">網址<a><ul><li><a href="http://www.baidu.com">百度</a></li><li><a href="http://www.sina.com">新浪</a></li></ul></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 class="last" style="border:none;"> <a href="#">關於<a></li></ul></div>    </body></html>




著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

Html + Css3 製作酷炫的導覽列

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.