<!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>
<title>导航菜单</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<!--把下面代码加到<head>与</head>之间--><style type="text/css">
/* 先把这个 xmenu 的样式放到css里 */
.xmenu td{font-size:12px;
  font-family:verdana,arial;
          font-weight:bolder;
  color:#ffffff;
  border:1px solid #336699;
  background:#336699;
  filter:blendtrans(duration=0.5);
  cursor:hand;
  text-align:center;}
</style><script>
/* 
http://lexrus.blueidea.com
这是把事件动作绑定到菜单上的函数
*/
function attachXMenu(objid){
var tds=objid.getElementsByTagName('td');
for(var i=0;i<tds.length;i++){
with(tds[i]){
onmouseover=function(){
with(this){
filters[0].apply();
style.background='#66CCFF'; //这是鼠标移上去时的背景颜色
style.border='1px solid #ffffff'; //边框
style.color='black'; //文字颜色
alert(i);
filters[0].play();
}
}
onmouseout=function(){
with(this){
filters[0].apply();
style.background='#336699'; //这是鼠标离开时的背景颜色
style.border='1px solid #336699'; //边框
style.color='#ffffff'; //文字颜色
filters[0].play();
}
}
}
}
}
</script>
</head>
<body>
<!--把下面代码加到<body>与</body>之间-->
<!--菜单从这里开始,注意要把class设置成和css里相同的,还要为它设一个id-->
横排
<table class="xmenu" id="xmenu0" width="500" cellpadding="1" cellspacing="4" border="0" bgcolor="#336699">
<tr>
<td>title1</td>
<td>title2</td>
<td>title3</td>
<td>title4</td>
<td>title5</td>
<td>title6</td>
</tr>
</table>
<script>attachXMenu(xmenu0); //在上面table结束地方执行动作绑定, xmenu0就是那个table的id</script>
</body>
</html>怎么在<td>title1</td>这几个title中加上<a href>后 比较自然 谢谢大家的意见