<div class="codetitle"> <span><a style="CURSOR: pointer" data="98893" class="copybut" id="copybut98893" onclick="doCopy('code98893')"><u>複製代碼</u></a></span>如下代碼:</div> <div class="codebody" id="code98893"> <br> <br> <br><hrad>; <br><metahttp-equiv content-type> <br><title>可折疊的兩層選單</title> <br><styletype> <br>正文{ <br>背景顏色:#ffdee0; <br>} <br>#navigation { <br>寬度:200px; <br>字型系列:Arial; <br>} <br># navigation > ul { <br>列表樣式類型:無; <br>邊距:0px; <br>內邊距:0px; <br>} <br>#navigation > ul > li { <br>border-bottomtom :1pxsolid #ED9F9F; <br>} <br>#navigation > ul>li> a{ <br>顯示:塊; <br>內邊距:5px5px 5px 0.5em; <br>文字裝飾:無; <br>左邊框:12pxsolid #711515; <br>右邊框:1pxsolid #711515; <br>} <br>#navigation > ul>li> a:鏈接,#navigation > ul > li > a:訪問過{ <br>背景顏色:#c11136; <br>顏色:#FFFFFF; <br>} <br>#navigation > ul>li> a:懸停{ <br>背景顏色:#990020; <br>顏色:#ffff00 ; <br>} <br>.txt{ <br>背景顏色:#c11136; <br>顏色:#FFFFFF; <br>內邊距:5px5px 5px 0.5em; <br>文字裝飾:無; >左邊框:12pxsolid #711515; <br>右邊框:1pxsolid #711515; <br>} <br><br>/* 子選單的CSS樣式*/ <br>#igation ul li ul> -style-type:none; <br>邊距:0px; <br>內邊距:0px0px 0px 0px; <br>} <br>#navigation ul li ulli{ <br>border-top:1pxsolid #EDF <br>} <br>#navigation ul li ulli a{ <br>display:block; <br>內邊距:3px3px 3px 0.5em; <br>文字裝飾:無; <br>左邊框:28psolid #fa7 ; <br>右邊框:1pxsolid #711515; <br>} <br>#navigation ul li ulli a:link, #navigationul li ul lia:visited{ <br>background-color:#e85070; #FFFFFF; <br>} <br>#navigation ul li ulli a:hover{ <br>背景顏色:#c2425d; <br>顏色:#ffff00; <br>} <br>#navigation ul li ul.myHidei { /* 隱藏子選單*/ <br>display:none; <br>} <br>#navigation ul li ul.myShow{ /* 顯示子選單*/ <br>display:block; <br>} display:block; <br>} <br>--> <br>樣式> <br><scriptlanguage> <br>window.onload=function(){ <br>varlistUL=document.getElementById("listUL"); <br>varolist =listUL.childNodes; <br>varoa=0; <br>for(var i = 0; i if(olist[i].tagName=="LI"&&olist[i ].getElementsByTagName("ul")[0] ){ <br>oa=olist[i]; <br>oa.onclick=更改; <br>} <br><br>} <br>functionchange(){ <br>varos=this.getElementsByTagName("ul")[0]; <br>if(os.className=="myHide") <br>os.className="myShow"; <br>其他<br>os .className="myHide"; <br>} <br>} <br>腳本> <br></scriptlanguage></styletype></metahttp-equiv></hrad> <br> <br><divid> <br><ulid> <br><li> <br><divclass>首頁</divclass> </li></ulid></divid> </div> <br> <br><li> <br><divclass>新聞; <br><ulclass> <br><li><ahref>最新消息</ahref></li> <br><li><ahref>所有新聞</ahref></li> <br> <br></ulclass></divclass> </li> <br><li> <br><divclass>體育 <br> <br><li><ahref>最新消息</ahref></li> <br><li><ahref>所有新聞 li> <br> <br></ahref></li> <br><li> <br><divclass>天氣; <br><ulclass> <br><li><ahref>最新消息</ahref></li> <br><li><ahref>所有新聞</ahref></li> <br> <br></ulclass></divclass> </li> <br> <br> <br>身體> <br> <br><br></divclass> </li>