CSS+JS實現的選項卡效果(html組件)

來源:互聯網
上載者:User
css|js|選項卡

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html lang="us-en"> 
<head>
<title>css選項卡(html組件)</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<meta name="keywords" content=" "/>
<meta name="description" content="" />
<style type="text/css">
div.card div{ background-color:#FF8000; float:left;  padding:1px; padding-bottom:0; clear:both; width:405px;}
div.card a{ color:black; font-size:14px; text-decoration:none;  float:left; width:100px; text-align:center; background-color:white; margin-right:1px;}
div.card div.home a.home{ font:normal normal bold 14px/1.5 宋體;}
div.card div.international a.international { font:normal normal bold 14px/1.5 宋體;}
div.card div.sport a.sport{ font:normal normal bold 14px/1.5 宋體;}
div.card div.finance a.finance{ font:normal normal bold 14px/1.5 宋體;}
div.card div.content{ background-color:white; border:1px solid #ff8000; height:100px;}
</style>
<script type="text/javascript">
var shq={}
shq.cmenu=function(e)
{
var e=window.event?window.event.srcElement:e.target;
        if(/a/i.test(e.tagName)){
        e.parentNode.className=e.className;
        e.parentNode.nextSibling.innerHTML=e.innerHTML;
        e.parentNode.nextSibling.style.cssText='border-top:none';
        e.blur();
        }
}
</script>
</head>
<body>
<div class="card">
<div >
<a href="#" class="home">國內</a>
<a href="#" class="international">國際</a>
<a href="#" class="sport">體育</a>
<a href="#" class="finance">財經</a>
</div><div class="content"></div>
</div>

<div class="card">
<div >
<a href="#" class="home">國內</a>
<a href="#" class="international">國際</a>
<a href="#" class="sport">體育</a>
<a href="#" class="finance">財經</a>
</div><div class="content"></div>
</div>

<div class="card">
<div >
<a href="#" class="home">國內</a>
<a href="#" class="international">國際</a>
<a href="#" class="sport">體育</a>
<a href="#" class="finance">財經</a>
</div><div class="content"></div>
</div>
</body>
</html>



相關文章

Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。