<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>标准布局应用:选项卡</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<meta name="Author" content="PR" />
<script type="text/javascript">
</script>
<style type="text/css">
/* 选项卡关键属性 */
#tab {
width:570px;
height:260px;
position:relative;
}

/*设置容器高宽等*/
html > body #tab {
width:566px;
}

/*兼容IE6:IE6下宽度不够*/
#tab div {
position:absolute;
top:26px;
left:0;
width:564px;
height:234px;
border:solid #eee;
border-width:0 1px 1px;
}

/*设置容器高宽等*/
#tab div {
display:none;
}

/*设置容器默认隐藏:不用ID是因为下面将利用class来控制容器显示,而class优先级低于id选择器*/
#tab .block {
display:block;
}

/*选中的容器*/
#tab h3 {
float:left;
width:114px;
height:26px;
line-height:26px;
margin:0 -1px 0 0;
font-size:14px;
cursor:pointer;
font-weight:400;
text-align:center;
color:#00007F;
background:#eee url(/upload/teaching/tab.gif) no-repeat;
}

/*默认标题样式*/
#tab .up {
background:#fff url(/upload/teaching/tab1.gif) no-repeat;
}

/*选中的标题样式*/
/*修饰列表内容*/
#tab ul {
margin:15px 0 0;
list-style:none;
padding:0;
}

#tab li {
float:left;
width:50%;
background:url(http://blog.pr1984.com/attachments/month_0612/a20061212105235.gif) no-repeat 25px 10px;
}

#tab li a {
display:block;
width:84%;
height:25px;
line-height:25px;
margin-left:8%;
font-size:12px;
text-decoration:none;
color:#333;
background:url(http://blog.pr1984.com/attachments/month_0612/g20061212105238.gif) repeat-x left bottom;
text-indent:10px;
}

#tab li a:hover {
text-decoration:underline;
color:red;
}
</style>
</head>
<body>
<div ;
   }
  }
 }
 //-->
 </script>
</div>
</body>
</html>


另一种

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Tab - 飞飞+PR</title>

<style type="text/css" media="all">
/*TAB布局*/
#tab * {font-size:12px;}
#tab h3 a {display:inline-block;}
#tab h3 a {display:block;}
#tab {position:relative;}
#tab h3,#tab ul,#tab div,#tab li {margin:0;padding:0;list-style-type:none;}
#tab ul li {position:absolute;left:0;top:0;float:left;display:block;width:100px;height:30px;font-size:0;}
#tab ul li#tab2 {left:100px;}
#tab ul li#tab3 {left:200px;}
#tab ul li#tab4 {left:300px;}
#tab ul li div {position:absolute;clear:both;}
#tab ul li div#oDIV2 {left:-100px;}
#tab ul li div#oDIV3 {left:-200px;}
#tab ul li div#oDIV4 {left:-300px;}

/*TAB-标题修饰*/
#tab,#tab ul li div,#tab ul li div li {width:450px;}/* 设置总宽度[width] */
#tab {height:200px;background:#ccc;overflow:hidden;}/* 设置总高度[height]、标题背景颜色[background] */
#tab ul li h3 a {height:18px;padding:5px 0 2px;margin:5px 0px 0px 5px;text-align:center;border:solid #ccc 1px;border-bottom:none;color:#333;}/* 标题默认状态

*/
#tab ul li h3 a:hover {background-color:#ddd;border-color:#fff;}/* 鼠标经过状态 */
#tab ul li.up h3 a {background:#999;border-color:#fff #999 #999 #fff;color:#fff;}/* 当前窗口状态 */
#tab ul li div {border:solid #999;border-width:1px 0;background:#f7f7f7;height:167px;}/* 设置内容高度[height]、背景颜色[background]、上下分割线[border] */
/*TAB1效果[ol/li]*/
#tab ul li #oDIV1 ol {margin:8px;padding:0;}
#tab ul li #oDIV1 ol li {position:static;float:none;font-size:0;height:auto;}
#tab ul li #oDIV1 ol li a {font-size:12px;display:block;padding:5px 0 1px;}
/*TAB2效果[img]*/
#tab ul li #oDIV2 img {margin:8px;border:none;}
/*TAB3效果[iframe]*/
#tab ul li #oDIV3 iframe {border:none;width:440px;height:157px;margin:5px;}
</style>

<script type="text/javascript">
<!--
function toggleTo(img)
{
var ts=document.getElementById("tab").getElementsByTagName("div");
for(i=1;i<ts.length+1;i++){
if(img==i)
{
document.getElementById("oDIV"+i).style.display = "";
document.getElementById("oDIV"+i).parentNode.className+=" up";
}
else{
document.getElementById("oDIV"+i).style.display = "none";
document.getElementById("oDIV"+i).parentNode.className="tab"+i;
}
}
}
-->
</script>

</head>

<body>
<div >22222</a></div>
 </li>
 </ul>
</div>
</body>
</html>

另一种

相关文章: