码迷,mamicode.com
首页 > 其他好文 > 详细

dw 选项卡

时间:2015-05-04 15:35:05      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:

选项卡实现代码:
<!DOCTYPE html>
<!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>无标题文档</title>
<style>
#biaodan {
	height: 600px;
	width: 365px;
	padding-top: 100px;
	margin-top: 0px;
	margin-right: auto;
	margin-bottom: 0px;
	margin-left: auto;
	font: "微软雅黑" 14px/30px;
}
body {
	margin: 0px;
	padding: 0px;
}
#shang{
	height: 30;
	text-align: center;
	border-Top: 3px solid #060;
	line-height: 30px;
	vertical-align: middle;
	}
#xia {
	height: 500px;
}
#junshi ul ,#zhengzhi ul,#wenhua ul{
	list-style-type: none;
}
a:link,a:visited,a:hover{
	text-decoration:none;
	}	
#zhengzhi,#wenhua{
	display:none;
	}
#biaodan #sp-junshi{
	width: 120px;
	height: 29px;
	border-left: 1px solid #666;
	border-right: 1px solid #666;
	float: left;
	border-bottom: none;
	background-color:none;
}
#biaodan #sp-zhengzhi{
	width: 120px;
	height: 29px;
	border-right: 1px solid #666;
	border-bottom: 1px solid #666;
	background-color: #cfcfcf;
	float: left;
}
#biaodan #sp-wenhua{
	width: 120px;
	height: 29px;
	border-right: 1px solid #666;
	border-bottom: 1px solid #666;
	background-color: #cfcfcf;
	float: left;
}
body {
	margin: 0px;
	padding: 0px;
}
</style>
<script>
function xianshijunshi(){
	//军事显示
	document.getElementById("junshi").style.display = "block";
	//政治隐藏
	document.getElementById("zhengzhi").style.display = "none";
	//文化隐藏
	document.getElementById("wenhua").style.display = "none";
	document.getElementById("sp-junshi").style.background = "none"
	document.getElementById("sp-zhengzhi").style.background ="#cfcfcf";
	document.getElementById("sp-wenhua").style.background ="#cfcfcf";
	document.getElementById("sp-junshi").style.borderBottom = "none"; 
	document.getElementById("sp-zhengzhi").style.borderBottom = "1px solid #666";
	document.getElementById("sp-wenhua").style.borderBottom = "1px solid #666";
	}
function xianshizhengzhi(){
	//军事隐藏
	document.getElementById("junshi").style.display = "none";
	//政治显示
	document.getElementById("zhengzhi").style.display = "block";
	//文化隐藏
	document.getElementById("wenhua").style.display = "none";
	document.getElementById("sp-junshi").style.background = "#cfcfcf"
	document.getElementById("sp-zhengzhi").style.background ="none";
	document.getElementById("sp-wenhua").style.background ="#cfcfcf";
	document.getElementById("sp-junshi").style.borderBottom = "1px solid #666"; 
	document.getElementById("sp-zhengzhi").style.borderBottom = "none";
	document.getElementById("sp-wenhua").style.borderBottom = "1px solid #666";
	}
function xianshiwenhua(){
	//军事隐藏
	document.getElementById("junshi").style.display = "none";
	//政治隐藏
	document.getElementById("zhengzhi").style.display = "none";
	//文化显示
	document.getElementById("wenhua").style.display = "block";
	document.getElementById("sp-junshi").style.background = "#cfcfcf"
	document.getElementById("sp-zhengzhi").style.background ="#cfcfcf";
	document.getElementById("sp-wenhua").style.background ="none"
	document.getElementById("sp-junshi").style.borderBottom = "1px solid #666"; 
	document.getElementById("sp-zhengzhi").style.borderBottom = "1px solid #666";
	document.getElementById("sp-wenhua").style.borderBottom = "none";
	}
</script>
</head>
<body>
<div id="biaodan">
  <div id="shang" >
    <div id="sp-junshi" class="s1" onMouseover="xianshijunshi()">军事</div>
    <div id="sp-zhengzhi" class="s2" onMouseover="xianshizhengzhi()">政治</div>
    <div id="sp-wenhua" class="s3" onMouseover="xianshiwenhua()">文化</div>
    <div style="clear:both;"></div>
  </div>
  <div id="xia">
    <div id="junshi" class ="info">
      <ul>
        <li><a href="#">军事军事军事军事军事军事军事军事</a></li>
        <li><a href="#">军事军事军事军事军事军事军事军事</a></li>
        <li><a href="#">军事军事军事军事军事军事军事军事</a></li>
        <li><a href="#">军事军事军事军事军事军事军事军事</a></li>
        <li><a href="#">军事军事军事军事军事军事军事军事</a></li>
        <li><a href="#">军事军事军事军事军事军事军事军事</a></li>
      </ul>
    </div>
    <div id="zhengzhi" class ="info">
      <ul>
        <li><a href="#">政治政治政治政治政治政治政治政治</a></li>
        <li><a href="#">政治政治政治政治政治政治政治政治</a></li>
        <li><a href="#">政治政治政治政治政治政治政治政治</a></li>
        <li><a href="#">政治政治政治政治政治政治政治政治</a></li>
        <li><a href="#">政治政治政治政治政治政治政治政治</a></li>
        <li><a href="#">政治政治政治政治政治政治政治政治</a></li>
      </ul>
    </div>
    <div id="wenhua" class ="info">
      <ul>
        <li><a href="#">文化文化文化文化文化文化文化文化</a></li>
        <li><a href="#">文化文化文化文化文化文化文化文化</a></li>
        <li><a href="#">文化文化文化文化文化文化文化文化</a></li>
        <li><a href="#">文化文化文化文化文化文化文化文化</a></li>
        <li><a href="#">文化文化文化文化文化文化文化文化</a></li>
        <li><a href="#">文化文化文化文化文化文化文化文化</a></li>
      </ul>
    </div>
  </div>
</div>
</body>
</html>


选项卡实现页面

技术分享

dw 选项卡

标签:

原文地址:http://blog.csdn.net/yzi_angel/article/details/45481381

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!