<!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制作的網站橫向導航菜單 knowsky.com</title>
<script>
window.onload=function(){
var li=document.getElementById("nav").getElementsByTagName("li");
for(var i=0;i<li.length;i++){
li[i].onmouSEOut=function(){
this.style.backgroundColor="";
}
li[i].onmouSEOver=function(){
this.style.backgroundColor="green";
}
}
}
</script>
</head>
<body style="background-color: #5396a4; background-repeat:repeat-x" >
<style>
ul,li{ margin:0px; padding:0px;list-style-type: none;}
li{background-color:gray}
#nav{}
#nav li{ float:left; margin-left:10px; height:30px; padding-top:8px; width:80px; text-align:center; overflow:hidden;}
#nav li a { margin-top:5px;}
#nav span{display:none;}
#nav a{font-size:13px;font-weight: bold;color: #FFFFFF;text-decoration: none; display:block;}
#nav a:hover{ color:#7c7c7c;top:1px; left:1px; position:relative;}
#nav a:hover span{ display:block; top:-2px; left:-2px; position:absolute; color:#FFFFFF;cursor:pointer; font-weight:bolder}
</style>
<div onmouseout="" onmouSEOver="" id="nav">
<ul>
<li><a href="#" >網站首頁<span>網站首頁</span></a></li>
<li><a href="#">網站首頁<span>網站首頁</span></a></li>
<li><a href="#" >網站首頁<span>網站首頁</span></a></li>
<li><a href="#">網站首頁<span>網站首頁</span></a></li>
<li><a href="#">網站首頁<span>網站首頁</span></a></li>
</ul>
</div>
</body>
</Html>