演示效果截圖
用到的圖片
CSS代碼
:link,:visited {text-decoration:none;}
ul,ol,dl {list-style:none;}
ul,ol,li,body,html,p{margin:0; padding:0;}
a img,:link img,:visited img {border:none;}
i {display:none;}
#navbar{width:740px;height:40px;background:url(navbar.gif)
no-repeat 0 0;position:relative;left:10px;top:35px;}
#navbar ul{position:absolute;top:0;height:40px;padding:0;}
#navbar ul.menu1{left:0;width:339px;}
#navbar ul li, ul.menu2 li{float:left;padding:0;}
#navbar li a, ul.menu2 li a{display:block;float:left;
height:40px;position:relative;padding-right:3px;}
#navbar li.m01 a{background:url(m01.gif) no-repeat 0 0;
width:49px; left:0 !important;}
#navbar li.m02 a{background:url(m02.gif) no-repeat -3px 0;
width:64px;}
#navbar li.m03 a{background:url(m03.gif) no-repeat -3px 0;
width:55px;}
#navbar li.m04 a{background:url(m04.gif) no-repeat -3px 0;
width:76px;}
#navbar li.m05 a{background:url(m05.gif) no-repeat -3px 0;
width:77px;}
#navbar li a:hover{background-position:-3px -40px;}
#navbar li.m01 a:hover{background-position:0 -40px;}
#navbar li.active a, #navbar li.active a:hover{
background-position:0 -80px;left:-3px;padding-right:6px;
margin-right:-3px;}
HTML代碼
<h3 style="padding:10px 0 0 10px;">www.865171.cn</h3>
<div id="navbar">
<ul class="menu1">
<li class="m01"><a >
<i>Home</i></a></li>
<li class="m02 active"><a >
<i>Changes</i></a></li>
<li class="m03"><a >
<i>People</i></a></li>
<li class="m04"><a >
<i>Nonprofits</i></a></li>
<li class="m05"><a >
<i>Politicians</i></a></li>
</ul>
</div>