读书人

IFRAME的HEIGHT的一个怪有关问题呀?

发布时间: 2012-02-26 20:19:44 作者: rapoo

IFRAME的HEIGHT的一个怪问题呀??
<%@ Page Language= "C# " AutoEventWireup= "true " CodeFile= "Default.aspx.cs " Inherits= "_Default " %>

<!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>
<SCRIPT language= "javascript " type= "text/javascript ">
if(self!=top){top.location=self.location;}
function switchSysBar(){
if (switchPoint.innerText==3){
switchPoint.innerText=4
document.all( "frmTitle ").style.display= "none "
}else{
switchPoint.innerText=3
document.all( "frmTitle ").style.display= " "
}}
</SCRIPT>

<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
</head>
<body MS_POSITIONING= "GridLayout ">
<BODY onresize=javascript:parent.ik8LeftFrame.location.reload() style= "MARGIN: 0px " scroll=no>
<TABLE height= "100% " cellSpacing=0 cellPadding=0 width= "100% " border=0>
<TR>
<TD width= "140 " align=middle vAlign=center noWrap id=frmTitle>
<!--为什么这里的IFRAME的HEIGHT: 100%这样子设为100%没有起作用呢,左边的页面只有20%那么高呢--> <IFRAME id=ik8LeftFrame style= "Z-INDEX: 2; WIDTH: 180px; HEIGHT: 100% " name=ik8LeftFrame src= "TaskMenu.html " frameBorder=0>
</IFRAME>
</TD>
<TD width= "16 " bgColor=ffffff style= "WIDTH: 9pt; border-left:1px solid #E8E8E8; border-right:2px solid #C6CAB1; ">
<TABLE height= "100% " cellSpacing=0 cellPadding=0 border=0 class= "table_mid ">
<TR>
<TD class= "td1 " onclick=switchSysBar()>
显示 <br>
/ <br> 隐藏 <br> 左侧导航 <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR>
<BR> <BR> <BR> <SPAN class=navPoint id=switchPoint title= "关闭/打开左栏 "> 3 </SPAN> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> 屏幕切换
</TD>
</TR>
</TABLE>
</TD>
<TD width= "663 " style= "WIDTH: 100% ">
<!--为什么这里的IFRAME的HEIGHT: 100%这样子设为100%没有起作用呢,左边的页面只有20%那么高呢--> <IFRAME id=ik8mainFrame style= "Z-INDEX: 1; VISIBILITY: inherit; WIDTH: 100%; HEIGHT: 100% " name=ik8MainFrame src= "TaskMenu_readme.html " frameBorder=0 scrolling=yes>


</IFRAME>
</TD>
</TR>
</TABLE>



</body>
</html>
以前是我在做一个ASP.NET的带后台管理的左侧弹出导航条时出现的问题,就是说框架的高度没有显示100%,只有显示20%左右大小,这样子就出现上面和下面都是空白的页面了,只有中间显示出网页了呀

[解决办法]
不奇怪,标准是不兼容的
问题出在
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
上,你没有了解http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd中属性的定义

<style type= "text/css ">
html,body{height:100%;margin:auto}即可

参见
】http://blog.csdn.net/net_lover/archive/2006/12/29/1467390.aspx

读书人网 >asp.net

热点推荐