图片地址:http://download.csdn.net/detail/richard_jason/9669782
效果图:
示例代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tab效果</title>
<style type="text/css">
<!--
*{margin:0;padding:0;border:none;text-shadow:1px 0 0 #ddd;}
a{text-decoration:none;}
img{border:0;}
.container{width:890px; overflow:hidden;font-size:14px; border:1px solid #ddd; border-top:2px solid #c00; margin:40px auto;}
#tabbox{width:895px; height:38px; overflow:hidden; background:#ddd; }
#tabbox span{font-family:"微软雅黑"; font-weight:bold;color:#333; background:#F4F5F5; display:block;width:178px; height:37px; line-height:37px; text-align:center; float:left; margin-right:1px; cursor:pointer;_display:inline;}
#tabbox span.curr{ background:#fff; border-bottom:1px solid #fff; color:#c00;}
#cont div{width:100%; overflow:hidden; display:none;}
#cont div dl{width:130px; margin:20px 24px; float:left;_display:inline;}
#cont div dl dt{margin-bottom:10px;}
#cont div dl dd img{width:130px; height:130px;}
#cont div dl dd.des{width:100%; height:32px; line-height:16px; overflow:hidden; font-size:12px;}
#cont div dl dd.des a{color:#333;}
#cont div dl dd.price{width:100%; height:16px; line-height:16px;font-size:12px;color:#999;}
#cont div dl dd.price span{font-weight:bold; color:#c00;}
#cont div.curr{display:block;}
-->
</style>
<script type="text/javascript">
<!--
function setCurr(index){
var arrSpan=document.getElementById("tabbox").getElementsByTagName("span");
for(var i=0;i<arrSpan.length;i++){arrSpan[i].className="";arrSpan[index].className="curr";}
var arrDiv=document.getElementById("cont").getElementsByTagName("div");
for(var j=0;j<arrDiv.length;j++){arrDiv[j].className="";arrDiv[index].className="curr";}
}
//-->
</script>
</head>