不錯的二級菜單代碼,採用CSS JS.html
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
<title>nav</title>
<scriptlanguage="javascript">
//JavaScriptDocument
startList=function()...{
if(document.all&&document.getElementById)...{
navRoot=document.getElementById("nav");
for(i=0;i<navRoot.childNodes.length;i++)...{
node=navRoot.childNodes[i];
if(node.nodeName=="LI")...{
node.onmouseover=function()...{
this.className+="over";
}
node.onmouseout=function()...{
this.className=this.className.replace("over","");
}
}
}
}
}
window.onload=startList;
</script>
<styletype="text/css">
<!--
body{...}{
font:normal11pxverdana;
}
ul{...}{
margin:0;
padding:0;
list-style:none;
width:150px;/**//*WidthofMenuItems*/
border-bottom:1pxsolid#ccc;
}
ulli{...}{
position:relative;
}
liul{...}{
position:absolute;
left:149px;/**//*Set1pxlessthanmenuwidth*/
top:0;
display:none;
}
/**//*StylesforMenuItems*/
ullia{...}{
display:block;
text-decoration:none;
color:#777;
background:#fff;/**//*IE6Bug*/
padding:5px;
border:1pxsolid#ccc;/**//*IE6Bug*/
border-bottom:0;
}
/**//*HollyHack.IERequirement*/
*htmlulli{...}{float:left;height:1%;}
*htmlullia{...}{height:1%;}
/**//*End*/
li:hoverul,li.overul{...}{display:block;}/**//*Themagic*/
-->
</style>
</head>
<body>
<ulid="nav">
<li><ahref="#">Home</a></li>
<li><ahref="#">About</a>
<ul>
<li><ahref="#">History</a></li>
<li><ahref="#">Team</a></li>
<li><ahref="#">Offices</a></li>
</ul>
</li>
<li><ahref="#">Services</a>
<ul>
<li><ahref="#">WebDesign</a></li>
<li><ahref="#">InternetMarketing</a></li>
<li><ahref="#">Hosting</a></li>
<li><ahref="#">DomainNames</a></li>
<li><ahref="#">Broadband</a></li>
</ul>
</li>
<li><ahref="#">ContactUs</a>
<ul>
<li><ahref="#">UnitedKingdom</a></li>
<li><ahref="#">France</a></li>
<li><ahref="#">USA</a></li>
<li><ahref="#">Australia</a></li>
</ul>
</li>
</ul>
</body>
</html>
推薦閱讀:
※【聊代碼】第十六集:移動標籤(之四)|老小孩博文
※《春夏秋冬》四款邊框、並含:代碼
※用代碼寫的漂亮字體
※29個音頻編輯程序源代碼下載第1頁
※製作邊框代碼