以下是效果:
程序代码
<style>
body {font-size:12px;font-family:宋体}
ul.TabBarLevel1{
list-style:none;
margin:0;
padding:0;
height:29px;
background-image:url(/webdesign/UploadFiles_9870/200702/20070202082317812.gif) right top no-repeat;
}
ul.TabBarLevel1 li a:link,ul.TabBarLevel1 li a:visited{
color:#333;
}
ul.TabBarLevel1 li a:hover,ul.TabBarLevel1 li a:active{
color:#F30;
text-decoration:none;
}
ul.TabBarLevel1 li.Selected a:link,ul.TabBarLevel1 li.Selected a:visited{
color:#000;
}
ul.TabBarLevel1 li.Selected a:hover,ul.TabBarLevel1 li.Selected a:active{
color:#F30;
text-decoration:none;
}
div.HackBox {
padding : 2px 2px ;
border-left: 2px solid #6697CD;
border-right: 2px solid #6697CD;
border-bottom: 2px solid #6697CD;
display:none;
}
</style>
<div id="Whatever">
<ul class="TabBarLevel1" id="TabPage1">
< li id="Tab1"><a href="#" >子虚乌有</a></li>
<li id="Tab2" class ="Selected"><a href="#" >金翅擘海</a></li>
<li id="Tab3"> <a href="#" ><B><font color="#22FF22">知</font>< font color="#FF2222">往</font><font color="#001199">观< /font><font color="#00fffa">来</font></B></a> </li>
<li id="Tab4"><a href="#" >我太低调</a></li>
</ul>
<div id="cnt">
<div id="dTab1" class="HackBox">我为每一次的快乐而哭泣,我为每一次的悲伤而微笑。
</div>
<div id="dTab2" class="HackBox" >
</div>
<div id="dTab3" class="HackBox">学习是件头疼的事,为了能活下去我不得不学习
</div>
<div id="dTab4" class="HackBox">仍然拣尽寒枝不肯安歇 微带着后悔 寂寞沙洲我该思念谁
</div>
</div>
</div>
<script language="">
//Switch Tab Effect
function switchTab(tabpage,tabid){
var oItem = document.getElementById(tabpage);
for(var i=0;i<oItem.children.length;i++){
var x = oItem.children(i);
x.className = "";
var y = x.getElementsByTagName('a');
y[0].style.color="#333333";
}
document.getElementById(tabid).className = "Selected";
var dvs=document.getElementById("cnt").getElementsByTagName("div");
for (var i=0;i<dvs.length;i++){
if (dvs.id==('d'+tabid))
dvs.style.display='block';
else
dvs.style.display='none';
}
}
</script>
一个不错的导航条
80酷酷网 80kuku.com