您的位置:首页 > 编程语言 > ASP

aspnet下Tab选项卡的使用(整理一)

2009-10-03 10:29 288 查看
在aspnet页面下,我们可能会遇到信息太多,在一个页面的一个屏幕的范围下,可能无法展现出来,这样我们可以考虑使用tab选项卡,写在aspx格式文件的源选项卡中。

下面举一个例子,将代码copy如下,本代码中共使用了三个选项卡:

<head runat="server">
<title>无标题页</title>
<meta content="text/html;charset=gb2312" http-equiv="Content-Type" />
<style type="text/css">
<!--
body,div,ul,li{
padding:0;
text-align:center;
}
body{
font:14px "宋体";
text-align:center;
}
a:link{
color:#00F;
text-decoration:none;
}
a:visited {
color: #00F;
text-decoration:none;
}
a:hover {
color: #c00;
text-decoration:underline;
}
ul{ list-style:none;}
/*选项卡1*/
#Tab1{
width:480px;
margin:0px;
padding:0px;
margin:0 auto;}
/*选项卡2*/
#Tab2{
width:576px;
margin:0px;
padding:0px;
margin:0 auto;}
/*菜单class*/
.Menubox {
width:100%;
height:28px;
line-height:28px;
}
.Menubox ul{
margin:0px;
padding:0px;
}
.Menubox li{
float:left;
display:block;
cursor:pointer;
width:160px;
text-align:center;
color:#949694;
font-weight:bold;
}
.Menubox li.hover{
padding:0px;
background:#fff;
width:158px;
border-left:1px solid #A8C29F;
border-top:1px solid #A8C29F;
border-right:1px solid #A8C29F;
background:#fff;
color:#739242;
font-weight:bold;
height:27px;
line-height:27px;
}
.Contentbox{
clear:both;
margin-top:0px;
border:1px solid #A8C29F;
border-top:none;
height:0px;
text-align:center;
padding-top:8px;
}
--></style>

note:这段代码的作用是为选项卡设置样式,下一步我们写javascript,其目的是当鼠标经过时,显示我们在body字段中设置的div层
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: