知识学堂
  • ·联系电话:+86.023-75585550
  • ·联系传真:+86.023-75585550
  • ·24小时手机:13896886023
  • ·QQ 咨 询:361652718 513960520
当前位置 > 首页 > 知识学堂 > 网站建设知识
CSS实现一张图完成的导航条
更新时间:2012-01-03 | 发布人:本站 | 点击率:757
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<title>网页特效-用CSS实现的一张图完成的导航条</title>
<style>
ul,li{ list-style:none; float:left;}
body{ font-size:12px; line-height:1.6; font-family:Verdana, "宋体", Arial; text-align:center;}
#info li{ margin-left:4px; margin-top:15px;}
#info a {display:block;text-align:center; padding-left:15px;
padding-top:2px;padding-bottom:1px;background-image:
url(/upfile/201213212944452.GIF);
background-repeat: no-repeat;color: #000; width:47px; cursor:hand; text-decoration: none;}
#job a:link,#job a:visited{background-position: -62px 0px;}
#eve a:link,#eve a:visited{background-position: -124px 0px;}
#oth a:link,#oth a:visited{background-position: -186px 0px;}
#car a:hover ,#car a:active {background-position: 0px -22px; color:#fff;}
#job a:hover ,#car a:active {background-position: -62px -22px; color:#fff;}
#eve a:hover ,#car a:active {background-position: -124px -22px; color:#fff;}
#oth a:hover ,#car a:active {background-position: -186px -22px; color:#fff;}
</style>
</head>
<body>
<div id="info">
 <ul>
  <li id="car"><a href="http://www.sanguo5.com" target="_blank"><span>游 戏</span></a></li>
  <li id="job"><a href="http://www.wangtx.com" target="_blank"><span>娱 乐</span></a></li>
  <li id="eve"><a href="http://www.pc555.com" target="_blank"><span>菜 单</span></a></li>
  <li id="oth"><a href="http://www.yamaxun.org" target="_blank"><span>好 玩</span></a></li>
 </ul>
</div>
<div style="clear:both">转载请注明出处<a href="http://www.qpsh.com"target="_blank">网页特效</a></div>
</body>
</html>
分享到: QQ空间 新浪微博 开心网 人人网