CSS實(shí)現(xiàn)帶陰影效果的黑色導(dǎo)航菜單效果
發(fā)布時間:2015-09-12 17:09:38 作者:佚名
我要評論

這篇文章主要為大家介紹了CSS實(shí)現(xiàn)帶陰影效果的黑色導(dǎo)航菜單效果,通過css設(shè)置背景圖片切換效果實(shí)現(xiàn)帶陰影的導(dǎo)航菜單功能,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
本文實(shí)例講述了CSS實(shí)現(xiàn)帶陰影效果的黑色導(dǎo)航菜單效果。分享給大家供大家參考。具體如下:
這是一款CSS實(shí)現(xiàn)帶陰影效果黑色導(dǎo)航菜單,有立體感,鼠標(biāo)放到菜單上會看到菜單的背景在變化,純CSS的代碼應(yīng)用,沒有使用任何的JavaScript代碼。如果你覺得菜單的背景顏色和文字顏色不是您想要的,你還可以自己修改CSS文件,只要你有創(chuàng)意,一個漂亮菜單就會誕生。
運(yùn)行效果截圖如下:
在線演示地址如下:
http://demo.jb51.net/js/2015/css-black-shadow-nav-style-codes/
具體代碼如下:
復(fù)制代碼
代碼如下:<!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>黑色炫酷個人網(wǎng)站導(dǎo)航菜單</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>
<div>
<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>
</div>
</body>
</html>
"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>黑色炫酷個人網(wǎng)站導(dǎo)航菜單</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>
<div>
<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>
</div>
</body>
</html>
希望本文所述對大家的div+css網(wǎng)頁設(shè)計(jì)有所幫助。
相關(guān)文章
- 超酷黑色帶陰影效果的導(dǎo)航菜單,同時還有立體感的效果,壓縮包附帶有菜單背景文件的PSD源文件,便于你修改背景圖片的顏色和風(fēng)格。2011-08-03
基于CSS實(shí)現(xiàn)帶陰影和小箭頭的黑色風(fēng)格下拉菜單效果
這篇文章主要為大家介紹了基于CSS實(shí)現(xiàn)帶陰影和小箭頭的黑色風(fēng)格下拉菜單效果,涉及使用css響應(yīng)hover樣式實(shí)現(xiàn)下拉菜單效果的相關(guān)技巧,界面美觀大方,具有一定參考借鑒價(jià)值,需2015-09-10- 這篇文章主要介紹了舉例詳解CSS中的text-shadow文字陰影效果使用,text-shadow的運(yùn)用是CSS入門學(xué)習(xí)中的基礎(chǔ)知識,需要的朋友可以參考下2015-08-19
- 這篇文章主要介紹了純CSS3實(shí)現(xiàn)的陰影效果的方法及示例代碼,非常的實(shí)用,這里推薦給大家。2014-12-24
- 是一款只使用CSS3實(shí)現(xiàn)的圖片帶陰影邊框的特效代碼,此段代碼適應(yīng)于所有網(wǎng)頁使用,有需要的朋友們可以前來下載使用2014-12-23
- 這篇文章主要介紹了使用CSS3實(shí)現(xiàn)圓角,陰影,透明的方法和示例代碼分析,非常的簡單實(shí)用,這里推薦給小伙伴們。2014-12-23
純CSS3實(shí)現(xiàn)的立體動畫菜單效果源碼 菜單項(xiàng)按下有內(nèi)陰影
這次小編來分享一款利用純CSS3實(shí)現(xiàn)的立體動畫菜單,該菜單的實(shí)現(xiàn)非常簡單,并沒有太多的特效渲染,但是看起來卻非常干凈漂亮,尤其配合灰黑色的背景,讓菜單顯得有點(diǎn)立體的2014-10-20- html中水平衡線hr看上去是有陰影效果的,去掉方法很簡單,在css里把border-bottom或border-top屬性設(shè)置一個為none即可2014-07-29