<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
.tab{
padding: 0;
width: 100%;
border-bottom: 5px solid #D25A0B;
background: transparent;
voice-family: "/"}/"";
voice-family: inherit;
}
.tab ul{
margin:0;
margin-left: 10px; /*margin between first menu item and left browser edge*/
padding: 0;
list-style: none;
}
.tab li{
display: inline;
margin: 0 2px 0 0;
padding: 0;
text-transform:uppercase;
}
.tab a{
float: left;
display: block;
font: bold 11px Arial;
color: white;
text-decoration: none;
margin: 0 1px 0 0; /*Margin between each menu item*/
padding: 5px 10px;
background-color: black; /*Brown color theme*/
border-top: 1px solid white;
}
.tab a:hover{
/*background-color: #D25A0B;*/ /*Brown color theme*/
color: white;
}
.tab a.selected{ /*currently selected tab*/
background-color: #D25A0B; /*Brown color theme*/
color: white;
border-color: #D25A0B; /*Brown color theme*/
}
-->
</style>
<script language="javascript" type="text/javascript">
function fGoto(url)
{
oFrame.location=url; //your url
ClearElement();
getsrcElement("A").style.backgroundColor = "#D25A0B";
}
function ClearElement()
{
var list = document.getElementsByTagName("a");
for (var i=0;i<list.length;i++)
{
list[i].style.backgroundColor = "";
}
}
function getsrcElement(oType)
{
var o = event.srcElement;
while (o.tagName != oType)
{
o = o.parentElement;
}
return o;
}
</script>
</head>
<body>
<div class="tab">
<ul id="ulTab">
<li><a href=# οnclick="fGoto('http://www.163.com')">tab1</a></li>
<li><a href=# οnclick="fGoto('http://www.sohu.com')">tab2</a></li>
<li><a href=# οnclick="fGoto('http://www.263.com')">tab3</a></li>
</ul>
</div>
<iframe frameborder="0" id="oFrame" scrolling="no" src="" style="text-align:left;height:248px;width: 100%"></iframe>
</body>
</html>
<!--tab控件有时候我们很需要,但是当我们去网找一个的时候,用起来总是那么的麻烦,要不就是买控件的,要不就是与我们所需要的有蛮大的差距.这个也是根据网上的代码稍加改造而来,其特点就是简单,简单,纯html.这样大家可以根据自己的需要再做进一步修改.-->