會(huì)做的大神,幫忙找下錯(cuò),謝謝
<!DOCTYPE html>
<html>
<head>
? ? <meta charset="UTF-8">
? ? <title>實(shí)踐題 - 選項(xiàng)卡</title>
? ? <style type="text/css">
? ? ?/* CSS樣式制作 */?
? ? ?/*格式化樣式*/
? ? body,ol,table,tr,td,dt,dd,dl,h1,h2,h3,h4,h5,h6,form,input,select,textarea{margin:0;padding:0; font-family:"微軟雅黑"; font-size:14px; color:#444; font-weight:normal;}
ul,li{margin:0;padding:0; font-family:"微軟雅黑";font-weight:normal;}?
? ? ul li{list-style-type: none;}
? ? ?/*代碼樣式*/
? ? #tab{width: 500px; height: 260px; background-color: #f7f7f7; border: 1px solid #eee; margin: 100px auto;}
? ? #tab ul{ ? ?height: 36px; width: 100%; clear: both; border-bottom: 1px solid #eee;}
? ? #tab ul li{float: left; width: 90px; text-align: center; line-height: 36px; color: #444444; border-right: 1px solid #EEEEEE; text-decoration: none;}
? ? #tab ul li:hover{color:red}
? ? .on{color: red !important;}
? ??
? ? #box{width: 460px; margin: auto; line-height: 28px;}
? ? .hide{display: none;}
? ??
? ? </style>
? ? <script type="text/javascript">
? ? window.onload = function(){
? ? ? ?var bhx=document.getElementById("tab");
? ? ? ?var bhy=bhx.getElementsByTagName("ul")[0];
? ? ? ?var bhz=bhy.getElementsByTagName("li");
? ? ? ?var bgdiv=bhx.getElementsByTagName("div");
? ? ? ?
? ? ? ?var len=bhz.length
? ? ? ?for(var i=0; i<len;i++){
? ? ? ? bhz[i].index=i;
? ? ? ? bhz[i].onclick = function(){
? ? ? ? for(var n=0; n<len; n++){
? ? ? ? bhz[n].className = "";
? ? ? ? ? ? ? ? bgdiv[n].className = "hide";
? ? ? ? }
? ? ? ? this.className = "on";
? ? ? ? bgdiv[this.index].className = "";
? ? ? ? }
? ? ? ?};
? ? }?
? ? </script>
</head>
<body>
<!-- HTML頁面布局 -->
<div id="tab">
<ul>
<li>房產(chǎn)</li>
<li>家居</li>
<li>二手房</li>
</ul>
<div id="box">
<div style="display: block;">
<p>275萬購昌平鄰鐵三居 總價(jià)20萬買一居
? ?200萬內(nèi)購五環(huán)三居 140萬安家東三環(huán)
? ?北京首現(xiàn)零首付樓盤 53萬購東5環(huán)50平
? ?京樓盤直降5000 中信府 公園樓王現(xiàn)房</p>?
</div>
<div>
<p> ?40平出租屋大改造 美少女的混搭小窩
? ? 經(jīng)典清新簡歐愛家 90平老房煥發(fā)新生
? ? 新中式的酷色溫 66平撞色活潑家居
? ? 瓷磚就像選好老婆 衛(wèi)生間煙道的設(shè)計(jì)</p>
</div>
<div>
<p>
通州豪華3居260萬 二環(huán)稀缺2居250w甩
? ? 西3環(huán)通透2居290萬 130萬2居限量搶購
? ? 黃城根小學(xué)學(xué)區(qū)僅260萬 121平70萬拋!
? ? 獨(dú)家別墅280萬 蘇州橋2居優(yōu)惠價(jià)248萬
</p>
</div>
</div>
</div>
</body>
</html>
2017-04-10
找到了