∥″可乐〃∥

让我展望未来,网络是我不变的终结者!

« 关于list定义图片不正常解决方法[美国][惊悚][变种巨鳗DVD中英双字] »

用一张图片做导航背景

这里采用的是背景定位,代码如下:

<!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>MAC风格的水平导航条(DIV+CSS)</title>
<style type="text/css">
body{
  background: #FFF;
  font-family: Arial, Helvetica, sans-serif;
  color: #666666;
  padding: 0px;
  margin: 5px;
  text-align: center; 
  font-size: 12px;
}

#nav{
  width: 400px;
  text-align: center;
  font-size: 11px;
  font-family: Arial, Helvetica, sans-serif;
  margin:15px auto;
}
#nav ul{
  margin: 0px;
  padding: 0px;
  list-style-type: none;
}
#nav li{ 
  float: left;
  }
#nav li a{
  text-decoration: none;
  color: #666; 
  background: url(http://www.makewing.com/lanren/menu/11/images/menubg.gif) no-repeat 0px 0px;
  width: 100px;
  line-height: 20px;
  display: block;
}
#nav li a:hover{
  color: #CC0000; 
  background: url(http://www.makewing.com/lanren/menu/11/images/menubg.gif) no-repeat 0px -20px; 
}
</style>
</head>

<body>

<div id="nav"><ul><li><a href="#">Home</a></li><li><a href="#">About us</a></li><li><a href="#">Products</a></li><li><a href="#">Services</a></li></ul></div>

</body>
</html>

Comments.

◎ welcome to participate in the discussion

日历

Comments.

Previous.

ADMIN. | EMAIL. | ABOUT.

Powered By Z-Blog 1.8 Spirit Build 80722Copyright © 2006-2011 可乐Blog Kele520.Com All Rights Reserved.[皖ICP备 06001314号]