CSS使用圖片美化的漂亮菜單效果

本文實(shí)例講述了CSS使用圖片美化的漂亮菜單效果。分享給大家供大家參考。具體如下:
這里介紹的這個(gè)菜單很漂亮,因?yàn)槊總€(gè)菜單項(xiàng)都是調(diào)用的圖片,感覺(jué)這個(gè)菜單有點(diǎn)華而不實(shí),畢竟菜單太多會(huì)影響網(wǎng)頁(yè)加載,一個(gè)菜單也沒(méi)有必要為了好看而犧牲太多,根據(jù)你的需要使用哦。
運(yùn)行效果截圖如下:
在線演示地址如下:
http://demo.jb51.net/js/2015/css-pic-cha-style-menu-demo/
具體代碼如下:
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>用圖片美化的CSS菜單</title>
<style>
body{background:#fff url(images/bkg_page.png);background-repeat:repeat-x;padding:0;margin:0;font-family:'Verdana';font-size:12px;color:#7f8991}
#header{margin:108px 0 0 100px}
#header em{display:none}
#header ul{width:100%;float:left;padding:0;margin:0;list-style-type:none}
#header li{float:left;padding:0;margin:0;display:inline}
#header li a{display:block;height:46px}
#header li a.home{background:url(images/menu_01.png) no-repeat left top;width:52px}
#header li a.homeActive{background:url(images/menu_01.png) no-repeat left bottom;width:52px}
#header li a.gallery{background:url(images/menu_02.png) no-repeat left top;width:60px}
#header li a.galleryActive{background:url(images/menu_02.png) no-repeat left bottom;width:60px}
#header li a.resources{background:url(images/menu_03.png) no-repeat left top;width:76px;margin:0;padding:0}
#header li a.resourcesActive{background:url(images/menu_03.png) no-repeat left bottom;width:76px}
#header li a.submit{background:url(images/menu_04.png) no-repeat left top;width:97px}
#header li a.submitActive{background:url(images/menu_04.png) no-repeat left bottom;width:97px}
#header li a.feed{background:url(images/menu_05.png) no-repeat left top;width:68px}
#header li a.feedActive{background:url(images/menu_05.png) no-repeat left bottom;width:68px}
#header li a.about{background:url(images/menu_06.png) no-repeat left top;width:52px}
#header li a.aboutActive{background:url(images/menu_06.png) no-repeat left bottom;width:52px}
#header li a.blog{background:url(images/menu_10.png) no-repeat left top;width:51px}
#header li a.blogActive{background:url(images/menu_10.png) no-repeat left bottom;width:51px}
#header li a.contact{background:url(images/menu_07.png) no-repeat left top;width:64px}
#header li a.contactActive{background:url(images/menu_07.png) no-repeat left bottom;width:64px}
#header li a:hover{background-position:left bottom}
</style>
</head>
<body>
<div id="header">
<ul>
<li><a class="homeActive" href="#"><em>home</em></a></li>
<li><a class="gallery" href="#"><em>gallery entries</em></a></li>
<li><a class="resources" href="#"><em>resources</em></a></li>
<li><a class="submit" href="#"><em>submit a site</em></a></li>
<li><a class="feed" href="#"><em>our feed</em></a></li>
<li><a class="blog" href="#"><em>blog</em></a></li>
<li><a class="about" href="#"><em>about</em></a></li>
<li><a class="contact" href="#"><em>contact</em></a></li>
</ul>
</div>
</body>
</html>
希望本文所述對(duì)大家的css網(wǎng)頁(yè)設(shè)計(jì)有所幫助。
相關(guān)文章
CSS實(shí)現(xiàn)自動(dòng)變?yōu)榇髮?xiě)的自適應(yīng)漂亮菜單效果
這篇文章主要為大家介紹了CSS實(shí)現(xiàn)自動(dòng)變?yōu)榇髮?xiě)的自適應(yīng)漂亮菜單效果,涉及css中text-transform屬性設(shè)置uppercase實(shí)現(xiàn)大寫(xiě)轉(zhuǎn)換的相關(guān)技巧,需要的朋友可以參考下2015-09-28CSS實(shí)現(xiàn)菜單背景自適應(yīng)寬度的方法
這篇文章主要為大家介紹了CSS實(shí)現(xiàn)菜單背景自適應(yīng)寬度的方法,涉及基于css屬性控制背景圖片自適應(yīng)寬度的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-09-28純CSS+XHTML實(shí)現(xiàn)的二級(jí)導(dǎo)航菜單效果
這篇文章主要為大家介紹了純CSS+XHTML實(shí)現(xiàn)的二級(jí)導(dǎo)航菜單效果,通過(guò)簡(jiǎn)單的鼠標(biāo)事件操作頁(yè)面元素樣式變換實(shí)現(xiàn)二級(jí)導(dǎo)航菜單的功能,非常簡(jiǎn)單實(shí)用,需要的朋友可以參考下2015-09-25CSS基于單張背景圖實(shí)現(xiàn)自適應(yīng)寬度的圓角菜單效果代碼
這篇文章主要為大家介紹了CSS基于單張背景圖實(shí)現(xiàn)自適應(yīng)寬度的圓角菜單效果代碼,基于css實(shí)現(xiàn)自適應(yīng)寬度的圓角菜單效果,非常簡(jiǎn)單實(shí)用,需要的朋友可以參考下2015-09-21純CSS實(shí)現(xiàn)的三級(jí)導(dǎo)航菜單效果代碼
這篇文章主要為大家介紹了純CSS實(shí)現(xiàn)的三級(jí)導(dǎo)航菜單效果代碼,通過(guò)css控制頁(yè)面元素樣式實(shí)現(xiàn)三級(jí)導(dǎo)航菜單效果,非常簡(jiǎn)單實(shí)用,需要的朋友可以參考下2015-09-18基于CSS實(shí)現(xiàn)的4級(jí)下拉菜單效果代碼
這篇文章主要為大家介紹了基于CSS實(shí)現(xiàn)的4級(jí)下拉菜單效果代碼,基于css通過(guò)對(duì)頁(yè)面元素樣式的設(shè)置實(shí)現(xiàn)四級(jí)下拉菜單的效果,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-09-17純CSS實(shí)現(xiàn)超簡(jiǎn)單的二級(jí)下拉導(dǎo)航菜單代碼
這篇文章主要為大家介紹了純CSS實(shí)現(xiàn)超簡(jiǎn)單的二級(jí)下拉導(dǎo)航菜單代碼,涉及css針對(duì)hover樣式設(shè)置的相關(guān)技巧,非常簡(jiǎn)單實(shí)用,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-09-15CSS實(shí)現(xiàn)的中英文雙語(yǔ)菜單效果代碼
這篇文章主要為大家介紹了CSS實(shí)現(xiàn)的中英文雙語(yǔ)菜單效果代碼,涉及css中hover屬性的使用技巧,界面美觀實(shí)用,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-09-15CSS實(shí)現(xiàn)帶有小圖片的LI圖標(biāo)列表菜單
這篇文章主要為大家介紹了CSS實(shí)現(xiàn)帶有小圖片的LI圖標(biāo)列表菜單,可實(shí)現(xiàn)css圖標(biāo)的正常顯示及滑過(guò)、點(diǎn)擊呈現(xiàn)不同顏色的功能,涉及css針對(duì)visited、hover及active等使用技巧,需要2015-09-15CSS實(shí)現(xiàn)有立體感的橫向按鈕式菜單效果代碼
這篇文章主要為大家介紹了CSS實(shí)現(xiàn)有立體感的橫向按鈕式菜單效果代碼,可實(shí)現(xiàn)鼠標(biāo)滑過(guò)呈現(xiàn)按鈕按下的效果,具有極強(qiáng)的3D立體效果,涉及css基于hover屬性的border邊框設(shè)置技巧,2015-09-15