
<!DOCTYPE?html>
<html>
<head?lang="en">
????<meta?charset="UTF-8">
????<title>實(shí)踐題?-?選項(xiàng)卡</title>
????<style?type="text/css">
????????/*?CSS樣式制作?*/
????????.total?{
????????????position:?relative;
????????}
????????input[type="button"]?{
????????????border:?none;
????????????padding:?0px;
????????????outline:?none;
????????????width:?80px;
????????????height:?30px;
????????????background:?#f2f2f2;
????????}
????????ul?{
????????????margin:?0px;
????????????position:?absolute;
????????????z-index:?999;
????????????top:?0px;
????????????left:?2px;
????????}
????????li?{
????????????width:?80px;
????????????height:?30px;
????????????text-align:?center;
????????????line-height:?30px;
????????????background:?#f2f2f2;
????????????display:?inline-block;
????????}
????????li.active?{
????????????z-index:?999;
????????????border-left:?2px?solid?#0ccccc;
????????????border-right:?2px?solid?#0ccccc;
????????????border-top:?5px?solid?#0ccccc;
????????????border-bottom:?5px?solid?#f2f2f2;
????????}
????????li.disable?{
????????????z-index:?1;
????????????padding-top:?4px;
????????????border-left:?1px?solid?#d2d2d2;
????????????border-right:?1px?solid?#d2d2d2;
????????????border-top:?1px?solid?#d2d2d2;
????????????border-bottom:?5px?solid?#0ccccc;
????????}
????????.con?{
????????????position:?absolute;
????????????z-index:?99;
????????????width:?300px;
????????????height:?180px;
????????????position:?relative;
????????????top:?35px;
????????????left:?2px;
????????????background:?#f2f2f2;
????????????margin-left:?30px;
????????????padding-left:?7px;
????????????border-left:?2px?solid?#0ccccc;
????????????border-right:?2px?solid?#0ccccc;
????????????border-top:?5px?solid?#0ccccc;
????????????border-bottom:?2px?solid?#0ccccc;
????????????display:?none;
????????}
????</style>
????<script?type="text/javascript">
????????window.onload?=?function?()?{
????????????var?cons?=?document.querySelectorAll(".con");
????????????var?links?=?document.querySelectorAll("li");
????????????Array.from(cons).forEach((c,?i)?=>?{
????????????????c.style.display?=?"none";
????????????????links[i].className?=?"disable";
????????????????if?(i?==?0)?{
????????????????????cons[i].style.display?=?"block";
????????????????????links[i].className?=?"active";
????????????????}
????????????});
????????????Array.from(links).forEach((link,?index,?ls)?=>?{
????????????????link.addEventListener("click",?function?(event)?{
????????????????????Array.from(cons).forEach((c,?i)?=>?{
????????????????????????c.style.display?=?"none";
????????????????????????links[i].className?=?"disable";
????????????????????});
????????????????????cons[index].style.display?=?"block";
????????????????????link.className?=?"active";
????????????????});
????????????});
????????}
????</script>
</head>
<body>
????<!--?HTML頁面布局?-->
????<div?class="total">
????????<div?class="con">
????????????<p>275萬購昌平鄰鐵三居?總價(jià)20萬買一居</p>
????????????<p>200萬內(nèi)購五環(huán)三居?140萬安家東三環(huán)</p>
????????????<p>北京首現(xiàn)零首付樓盤?53萬購東5環(huán)50平</p>
????????????<p>京樓盤直降5000?中信府?公園樓王現(xiàn)房</p>
????????</div>
????????<div?class="con">
????????????<p>40平出租屋大改造?美少女的混搭小窩</p>
????????????<p>經(jīng)典清新簡(jiǎn)歐愛家?90平老房煥發(fā)新生</p>
????????????<p>新中式的酷色溫情?66平撞色活潑家居</p>
????????????<p>瓷磚就像選好老婆?衛(wèi)生間煙道的設(shè)計(jì)</p>
????????</div>
????????<div?class="con">
????????????<p>通州豪華3居260萬?二環(huán)稀缺2居250w甩</p>
????????????<p>西3環(huán)通透2居290萬?130萬2居限量搶購</p>
????????????<p>黃城根小學(xué)學(xué)區(qū)僅260萬?121平70萬拋!</p>
????????????<p>獨(dú)家別墅280萬?蘇州橋2居優(yōu)惠價(jià)248萬</p>
????????</div>
????????<ul>
????????????<li><input?type="button"?value="房產(chǎn):"?/></li>
????????????<li><input?type="button"?value="家居:"?/></li>
????????????<li><input?type="button"?value="二手房:"?/></li>
????????</ul>
????</div>
</body>
</html>
2019-09-27
你可以先把代碼復(fù)制進(jìn)輸入框,接著右鍵全選代碼,然后直接在代碼語言里選擇HTML,這樣代碼就不會(huì)變成一行。