CSS属性display在火狐浏览器下面的问题,求助大神,在线等
<scriptlanguage="JavaScript"type="text/javascript">functionsecBoard0(n){for(i=0;i<sec...
<script language="JavaScript" type="text/javascript">
function secBoard0(n)
{
for(i=0;i<secTable0.cells.length;i++)
secTable0.cells[i].className="sec01";
secTable0.cells[n].className="sec02";
for(i=0;i<mainTable0.tBodies.length;i++)
mainTable0.tBodies[i].style.display="none";
mainTable0.tBodies[n].style.display="block";
}
</script>
<td width="48%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="box_c_2" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="15"> </td>
<td width="161">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="secTable0">
<tr>
<td class="sec02" onmouseover="secBoard0(0)">第一条栏目</td>
<td class="sec01" onmouseover="secBoard0(1)">第二栏目</td>
</tr>
</table>
</td>
<td align="right" class="tit_5"><a href="/public/index.php?LocationID=0200000000" target="_self">更多>></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right"><img src="images/c_bg.gif" width="317" height="4" hspace="2" /></td>
</tr>
<tr>
<td class="box_yw">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="mainTable0">
<tbody style="display:block;">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="font_1">
<tr>
<td valign="top" style="width:330px;">
block在非IE得浏览器中没用呀
</td>
</tr>
</table>
</td>
</tr>
</tbody>
<tbody style="display:none;">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="font_1">
<tr>
<td valign="top">
怎么才能切换呀
</td>
</tr>
</table>
</td>
</tr> 展开
function secBoard0(n)
{
for(i=0;i<secTable0.cells.length;i++)
secTable0.cells[i].className="sec01";
secTable0.cells[n].className="sec02";
for(i=0;i<mainTable0.tBodies.length;i++)
mainTable0.tBodies[i].style.display="none";
mainTable0.tBodies[n].style.display="block";
}
</script>
<td width="48%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="box_c_2" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="15"> </td>
<td width="161">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="secTable0">
<tr>
<td class="sec02" onmouseover="secBoard0(0)">第一条栏目</td>
<td class="sec01" onmouseover="secBoard0(1)">第二栏目</td>
</tr>
</table>
</td>
<td align="right" class="tit_5"><a href="/public/index.php?LocationID=0200000000" target="_self">更多>></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right"><img src="images/c_bg.gif" width="317" height="4" hspace="2" /></td>
</tr>
<tr>
<td class="box_yw">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="mainTable0">
<tbody style="display:block;">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="font_1">
<tr>
<td valign="top" style="width:330px;">
block在非IE得浏览器中没用呀
</td>
</tr>
</table>
</td>
</tr>
</tbody>
<tbody style="display:none;">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="font_1">
<tr>
<td valign="top">
怎么才能切换呀
</td>
</tr>
</table>
</td>
</tr> 展开
4个回答
展开全部
我信息给你写了一个··
兼容所有浏览器
<!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 type="text/css">
body { margin:0; padding:0; font-size:12px; font-family:Verdana, Geneva, sans-serif;}
.tab_all { width:800px; height:auto; margin:0 auto; margin-top:50px;}
.tab_menu { width:800px; height:30px;}
.tab_menu ul{ list-style:none; margin:0; padding:0; width:800px; height:30px;}
.tab_menu li{ width:100px; height:30px; float:left; margin-right:5px; cursor:pointer; color:#FFF; font-weight:bold; text-align:center; line-height:30px;}
.tab_menu li:hover {width:100px; height:30px; background-color:#F93; float:left; margin-right:5px;}
.tab_menu_li1{ background-color:#F93;}
.tab_menu_li2{background-color:#F00;}
.tab_txt { width:798px; height:500px; background-color: #F93; }
</style>
<script language="javascript" type="text/javascript">
function oc(ii)
{
var alldivTitle = document.getElementById("alltitle").getElementsByTagName("li");
var alldiv = document.getElementById("all").getElementsByTagName("div");
for (var i = 0; i < alldiv.length; i ++)
{
if ((i + 1) == parseInt(ii))
{
alldivTitle[i].className = "tab_menu_li1";
alldiv[i].style.display = "block";
}
else
{
alldivTitle[i].className = "tab_menu_li2";
alldiv[i].style.display = "none";
}
}
}
</script>
</head>
<body>
<div class="tab_all">
<div class="tab_menu">
<ul id="alltitle">
<li class="tab_menu_li1" onclick="oc(1)">1</li>
<li class="tab_menu_li2" onclick="oc(2)">2</li>
<li class="tab_menu_li2" onclick="oc(3)">3</li>
<li class="tab_menu_li2" onclick="oc(4)">4</li>
<li class="tab_menu_li2" onclick="oc(5)">5</li>
</ul>
</div>
<div id="all">
<div class="tab_txt" style="display:block;">1111111111111111111111</div>
<div class="tab_txt" style="display:none;">22222222222222222222222</div>
<div class="tab_txt" style="display:none;">3333333333333333333333333</div>
<div class="tab_txt" style="display:none;">44444444444444444444444444</div>
<div class="tab_txt" style="display:none;">555555555555555555555555</div>
</div>
</div>
</body>
</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 type="text/css">
body { margin:0; padding:0; font-size:12px; font-family:Verdana, Geneva, sans-serif;}
.tab_all { width:800px; height:auto; margin:0 auto; margin-top:50px;}
.tab_menu { width:800px; height:30px;}
.tab_menu ul{ list-style:none; margin:0; padding:0; width:800px; height:30px;}
.tab_menu li{ width:100px; height:30px; float:left; margin-right:5px; cursor:pointer; color:#FFF; font-weight:bold; text-align:center; line-height:30px;}
.tab_menu li:hover {width:100px; height:30px; background-color:#F93; float:left; margin-right:5px;}
.tab_menu_li1{ background-color:#F93;}
.tab_menu_li2{background-color:#F00;}
.tab_txt { width:798px; height:500px; background-color: #F93; }
</style>
<script language="javascript" type="text/javascript">
function oc(ii)
{
var alldivTitle = document.getElementById("alltitle").getElementsByTagName("li");
var alldiv = document.getElementById("all").getElementsByTagName("div");
for (var i = 0; i < alldiv.length; i ++)
{
if ((i + 1) == parseInt(ii))
{
alldivTitle[i].className = "tab_menu_li1";
alldiv[i].style.display = "block";
}
else
{
alldivTitle[i].className = "tab_menu_li2";
alldiv[i].style.display = "none";
}
}
}
</script>
</head>
<body>
<div class="tab_all">
<div class="tab_menu">
<ul id="alltitle">
<li class="tab_menu_li1" onclick="oc(1)">1</li>
<li class="tab_menu_li2" onclick="oc(2)">2</li>
<li class="tab_menu_li2" onclick="oc(3)">3</li>
<li class="tab_menu_li2" onclick="oc(4)">4</li>
<li class="tab_menu_li2" onclick="oc(5)">5</li>
</ul>
</div>
<div id="all">
<div class="tab_txt" style="display:block;">1111111111111111111111</div>
<div class="tab_txt" style="display:none;">22222222222222222222222</div>
<div class="tab_txt" style="display:none;">3333333333333333333333333</div>
<div class="tab_txt" style="display:none;">44444444444444444444444444</div>
<div class="tab_txt" style="display:none;">555555555555555555555555</div>
</div>
</div>
</body>
</html>
祝你成功!
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
楼主可以在些代码上加个div
<div style="display:block;">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="font_1">
<tr>
<td valign="top" style="width:330px;">
block在非IE得浏览器中没用呀
.....
</div>
试试
<div style="display:block;">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="font_1">
<tr>
<td valign="top" style="width:330px;">
block在非IE得浏览器中没用呀
.....
</div>
试试
追问
不顶用呀
追答
lz可以描述的不清楚,可以发代码和图片到邮箱,html打开为你此时错误的真实表现。。
tian01ming@163.com
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Vue实践-CSS样式position/display/float属性对比使用
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
您好!很高兴为您答疑!
火狐下您可以安装Firebug检查页面代码,错误部分有高亮提示,更多建站教程,您可以参考:http://www.w3school.com.cn
您可以在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。
火狐下您可以安装Firebug检查页面代码,错误部分有高亮提示,更多建站教程,您可以参考:http://www.w3school.com.cn
您可以在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询