<!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=utf-8" />
<title>导航菜单</title>
<style type="text/css">
*{margin:0; padding:0; font-size:14px;}
a{color:#333;text-decoration:none}
.nav{list-style:none; height:30px; border-bottom:5px solid #F60; margin-top:20px; padding-left:50px;}
.nav li{float:left}
.nav li a{display:block; height:30px;text-align:center; line-height:30px; width:120px; border-radius:12px 12px 0 0; margin-left:1px;background-color:#ddd;}
.nav li a.on ,nav li a:hover{color:#fff;background-color:#F60;height:40px; line-height:40px; margin-top:-10px;}
</style>
</head>
<body>
<ul class="nav" id="nav">
<li><a class="on" href="javascript:void(0);">首 页</a></li>
<li><a href="javascript:void(0);">新闻快讯</a></li>
<li><a href="javascript:void(0);">产品展示</a></li>
<li><a href="javascript:void(0);">售后服务</a></li>
<li><a href="javascript:void(0);">联系我们</a></li>
</ul>
<script>
var nav = document.getElementById('nav');
var navList = nav.getElementsByTagName('a');
for(var i = 0;i < navList.length; i++){
navList[i].onclick = function(){
for(var j = 0;j < navList.length; j++){
navList[j].className = '';
}
this.className = 'on'
}
}
</script>
</body>
</html>