如何用CSS實現帶陰影製作效果的黑色導覽功能表效果

來源:互聯網
上載者:User
這篇文章主要為大家介紹了CSS實現帶陰影製作效果的黑色導覽功能表效果,通過css設定背景圖片轉場效果實現帶陰影的導覽功能表功能,具有一定參考借鑒價值,需要的朋友可以參考下

本文執行個體講述了CSS實現帶陰影製作效果的黑色導覽功能表效果。分享給大家供大家參考。具體如下:

這是一款CSS實現帶陰影製作效果黑色導覽功能表,有立體感,滑鼠放到菜單上會看到菜單的背景在變化,純CSS的代碼應用,沒有使用任何的JavaScript代碼。如果你覺得菜單的背景顏色和文字顏色不是您想要的,你還可以自己修改CSS檔案,只要你有創意,一個漂亮菜單就會誕生。

運行效果如下:

具體代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>黑色炫酷個人網站導覽功能表</title><style>.bg {background: url(images/button4.gif);}.menu {padding:0 0 0 32px; margin:0; list-style:none; height:40px; background:#fff url(images/button1a.gif) repeat-x; position:relative; font-family:arial, verdana, sans-serif; margin-top:100px;}.menu li.top {display:block; float:left; position:relative;}.menu li a.top_link {display:block; float:left; height:40px; line-height:33px; color:#bbb; text-decoration:none; font-size:11px; font-weight:bold; padding:0 0 0 12px; cursor:pointer;}.menu li a.top_link span {float:left; font-weight:bold; display:block; padding:0 24px 0 12px; height:40px;}.menu li a.top_link span.down {float:left; display:block; padding:0 24px 0 12px; height:40px; background:url(images/down.gif) no-repeat right top;}.menu li a.top_link:hover {color:#000; background: url(images/button4.gif) no-repeat;}.menu li a.top_link:hover span {background:url(images/button4.gif) no-repeat right top;}.menu li a.top_link:hover span.down {background:url(images/button4a.gif) no-repeat right top;}.menu li:hover > a.top_link {color:#000; background: url(images/button4.gif) no-repeat;}.menu li:hover > a.top_link span {background:url(images/button4.gif) no-repeat right top;}.menu li:hover > a.top_link span.down {background:url(images/button4a.gif) no-repeat right top;}.menu table {border-collapse:collapse; width:0; height:0; position:absolute; top:0; left:0;}.menu a:hover {visibility:visible;}.menu li:hover {position:relative; z-index:200;}.menu ul, .menu :hover ul ul, .menu :hover ul :hover ul ul,.menu :hover ul :hover ul :hover ul ul,.menu :hover ul :hover ul :hover ul :hover ul ul {position:absolute; left:-9999px; top:-9999px; width:0; height:0; margin:0; padding:0; list-style:none;}.menu :hover ul.sub {left:2px; top:40px; right:2px; background: #fff; padding:3px 0; border:1px solid #999999; white-space:nowrap; width:200px; height:auto;}.menu :hover ul.sub li {display:block; height:20px; position:relative; float:left; width:250px;}.menu :hover ul.sub li a {font-weight:normal;display:block; font-size:11px; height:20px; width:192px; line-height:20px; text-indent:5px; color:#000; text-decoration:none; border:3px solid #fff; border-width:0 0 0 3px;}.menu :hover ul.sub li a.fly {background:#fff url(images/arrow.gif) 80px 7px no-repeat;}.menu :hover ul.sub li a:hover {background:#999999; color:#fff;}.menu :hover ul.sub li a.fly:hover {background:#999999 url(images/arrow_over.gif) 80px 7px no-repeat; color:#fff;}.menu :hover ul li:hover > a.fly {background:#999999 url(images/arrow_over.gif) 80px 7px no-repeat; color:#fff;} .menu :hover ul :hover ul,.menu :hover ul :hover ul :hover ul,.menu :hover ul :hover ul :hover ul :hover ul,.menu :hover ul :hover ul :hover ul :hover ul :hover ul{left:90px; top:-4px; background: #fff; padding:3px 0; border:1px solid 999999; white-space:nowrap; width:93px; z-index:200; height:auto;}</style></head><body><p><ul class="menu">    <li class="top"><a href="#" class="top_link"><span>首頁</span></a></li>    <li class="top"><a href="#" class="top_link"><span>我的相簿</span></a></li>    <li class="top"><a href="#" class="top_link"><span>我的日誌</span></a></li>    <li class="top"><a href="#" class="top_link"><span>我的音樂盒</span></a></li>    <li class="top"><a href="#" class="top_link"><span>我的介紹</span></a></li>    <li class="top"><a href="#" class="top_link"><span>留言本</span></a></li></ul></p></body></html>

以上就是本文的全部內容,希望對大家的學習有所協助,更多相關內容請關注topic.alibabacloud.com!

相關文章

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.