一段css tab选项卡的问题
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!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>
<title> </title>
<style type="text/css">
<!--
div,ul,li{
margin:0 auto;
padding:0;
}
.main{
clear:both;
padding:8px;
text-align:center;
}
#tabs1{
text-align:left;
width:440px;
}
.menu1box{
position:relative;
overflow:hidden;
height:30px;
width:440px;
text-align:left;
}
#menu1{
position:absolute;
top:0;
left:0;
z-index:1;
}
#menu1 li{
float:left;
display:block;
cursor:pointer;
width:219px;
text-align:center;
line-height:30px;
height:30px;
}
#menu1 li.hover{
background:#fff;
border-left:1px solid #E4E4E4;
border-top:1px solid #E4E4E4;
border-right:1px solid #E4E4E4;
}
.main1box{
clear:both;
margin-top:-1px;
border:1px solid #E4E4E4;
height:268px;
width:440px;
}
#main1 ul{
display: none;
}
#main1 ul.block{
display: block;
}
-->
</style>
<script>
<!--
function setTab(m,n){
var tli=document.getElementById("menu"+m).getElementsByTagName("li");
var mli=document.getElementById("main"+m).getElementsByTagName("ul");
for(i=0;i <tli.length;i++){
tli[i].className=i==n?"hover":"";
mli[i].style.display=i==n?"block":"none";
}
}
//-->
</script>
<div id="tabs1">
<div class="menu1box">
<ul id="menu1">
<li class="hover" onmouseover="setTab(1,0)"> <a href="#">最新资讯 </a> </li>
<li onmouseover="setTab(1,1)"> <a href="#">行业动态 </a> </li>
</ul>
</div>
<div class="main1box">
<div class="main" id="main1">
<ul class="block"> <li>新闻列表 </li> </ul>
<ul> <li>评论列表 </li> </ul>
<ul> <li>技术列表 </li> </ul>
<ul> <li>点评列表 </li> </ul>
</div>
</div>
</div>
总宽度是 440 我想一个选项卡给 220 可是就是不行 只能给到 width:219px;
麻烦帮着看看 谢谢 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> </title>
<style type="text/css">
<!--
div,ul,li{
margin:0 auto;
padding:0;
}
.main{
clear:both;
padding:8px;
text-align:center;
}
#tabs1{
text-align:left;
width:440px;
}
.menu1box{
position:relative;
overflow:hidden;
height:30px;
width:440px;
text-align:left;
}
#menu1{
position:absolute;
top:0;
left:0;
z-index:1;
}
#menu1 li{
float:left;
display:block;
cursor:pointer;
width:219px;
text-align:center;
line-height:30px;
height:30px;
}
#menu1 li.hover{
background:#fff;
border-left:1px solid #E4E4E4;
border-top:1px solid #E4E4E4;
border-right:1px solid #E4E4E4;
}
.main1box{
clear:both;
margin-top:-1px;
border:1px solid #E4E4E4;
height:268px;
width:440px;
}
#main1 ul{
display: none;
}
#main1 ul.block{
display: block;
}
-->
</style>
<script>
<!--
function setTab(m,n){
var tli=document.getElementById("menu"+m).getElementsByTagName("li");
var mli=document.getElementById("main"+m).getElementsByTagName("ul");
for(i=0;i <tli.length;i++){
tli[i].className=i==n?"hover":"";
mli[i].style.display=i==n?"block":"none";
}
}
//-->
</script>
<div id="tabs1">
<div class="menu1box">
<ul id="menu1">
<li class="hover" onmouseover="setTab(1,0)"> <a href="#">最新资讯 </a> </li>
<li onmouseover="setTab(1,1)"> <a href="#">行业动态 </a> </li>
</ul>
</div>
<div class="main1box">
<div class="main" id="main1">
<ul class="block"> <li>新闻列表 </li> </ul>
<ul> <li>评论列表 </li> </ul>
<ul> <li>技术列表 </li> </ul>
<ul> <li>点评列表 </li> </ul>
</div>
</div>
</div>
总宽度是 440 我想一个选项卡给 220 可是就是不行 只能给到 width:219px;
麻烦帮着看看 谢谢 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询