框架调用的default.aspx
框架如下:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<frameset framespacing="1" border="0" frameborder="0" rows="70,*,25">
<form id="form1" runat="server">
<frame name="top" scrolling="no" noresize="noresize" target="contents" src="top.aspx" marginheight="4">
<frameset cols="140,8,*" name="main_m">
<frame name="left" src="left.aspx?power=<%=power%>" scrolling="auto" noresize="noresize" target="main" >
<frame name="cen" src="default.aspx" marginwidth="0" marginheight="0" scrolling="auto" noresize="noresize" style="padding: 0px">
<frame name="main" src="index_left.aspx" marginwidth="0" marginheight="0" scrolling="auto" noresize="noresize" style="padding: 0px">
</frameset>
<frame name="bottom" scrolling="no" noresize="noresize" src="boot.aspx" style=" vertical-align:top" marginheight="2">
<noframes>
<body>
<p>此网页使用了框架,但您的浏览器不支持框架。</p> </body>
</noframes>
</form>
</frameset> 文件名:default.aspx<%@ 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 runat="server">
<title>无标题页</title>
<script language="JavaScript" type="text/javascript">
<!--
function changeState()
{
if(parent.document.getElementById('main_m').cols!="140,8,*")
{
parent.document.getElementById('main_m').cols="140,8,*";
parent.document.getElementById('left').style.display="";
image1Id.src = "../images/left.gif";
}
else
{
parent.document.getElementById('main_m').cols = "0,8,*";
parent.document.getElementById('left').style.display="none";
image1Id.src = "../images/right.gif";
}
} //-->
</script></head>
<body style="background-color:Blue;" >
<form id="form1" runat="server">
<div>
<table height="100%" cellspacing="0" cellpadding="0" border="0" >
<tbody>
<tr >
<td height="100%" style="width: 9px; vertical-align: middle; text-align: center;" >
<img id="image1Id" src="images/left.gif" onclick="changeState();" alt="关闭/打开左栏" border="0" />
</td>
</tr>
</tbody>
</table>
</div>
</form>
</body>
</html>
就是里面那个<img id="image1Id" src="images/left.gif" onclick="changeState();" alt="关闭/打开左栏" border="0" />死活不垂直居中,在页面里看是正常的居中了,可是运行起来还是不居中.图片有时还不变?郁闷啊!光前台代码,无后台的!谢谢!是不是和IE有关系?
框架如下:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<frameset framespacing="1" border="0" frameborder="0" rows="70,*,25">
<form id="form1" runat="server">
<frame name="top" scrolling="no" noresize="noresize" target="contents" src="top.aspx" marginheight="4">
<frameset cols="140,8,*" name="main_m">
<frame name="left" src="left.aspx?power=<%=power%>" scrolling="auto" noresize="noresize" target="main" >
<frame name="cen" src="default.aspx" marginwidth="0" marginheight="0" scrolling="auto" noresize="noresize" style="padding: 0px">
<frame name="main" src="index_left.aspx" marginwidth="0" marginheight="0" scrolling="auto" noresize="noresize" style="padding: 0px">
</frameset>
<frame name="bottom" scrolling="no" noresize="noresize" src="boot.aspx" style=" vertical-align:top" marginheight="2">
<noframes>
<body>
<p>此网页使用了框架,但您的浏览器不支持框架。</p> </body>
</noframes>
</form>
</frameset> 文件名:default.aspx<%@ 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 runat="server">
<title>无标题页</title>
<script language="JavaScript" type="text/javascript">
<!--
function changeState()
{
if(parent.document.getElementById('main_m').cols!="140,8,*")
{
parent.document.getElementById('main_m').cols="140,8,*";
parent.document.getElementById('left').style.display="";
image1Id.src = "../images/left.gif";
}
else
{
parent.document.getElementById('main_m').cols = "0,8,*";
parent.document.getElementById('left').style.display="none";
image1Id.src = "../images/right.gif";
}
} //-->
</script></head>
<body style="background-color:Blue;" >
<form id="form1" runat="server">
<div>
<table height="100%" cellspacing="0" cellpadding="0" border="0" >
<tbody>
<tr >
<td height="100%" style="width: 9px; vertical-align: middle; text-align: center;" >
<img id="image1Id" src="images/left.gif" onclick="changeState();" alt="关闭/打开左栏" border="0" />
</td>
</tr>
</tbody>
</table>
</div>
</form>
</body>
</html>
就是里面那个<img id="image1Id" src="images/left.gif" onclick="changeState();" alt="关闭/打开左栏" border="0" />死活不垂直居中,在页面里看是正常的居中了,可是运行起来还是不居中.图片有时还不变?郁闷啊!光前台代码,无后台的!谢谢!是不是和IE有关系?
解决方案 »
- 求基于TCP/IP实现的服务器端是窗体应用程序的最简单的WCF例子
- .NET WinForm中TreeView控件使用
- c# windows程序 用户控件如何访问父窗口函数
- 请问下,DataGridView的增加,修改,删除
- WinForm程序找不到文件(Could not load file or assembly 'Microsoft.mshtml')
- C#学习群,交流学习。
- []内的内容。。。内详!!!!![ClassInterface(ClassInterfaceType.AutoDual)]
- 让我们的WinXP同时出来两个亮的标题栏窗口,不信,进来看看!
- 如何用is关键字看struct是否是Object?
- 电子书籍的下载
- 求一图片的正则表达式
- 在开发c#中怎么用键盘
<table height="100%" cellspacing="0" cellpadding="0" border="0" >
.......</table>
<center>
<center>
<img id="image1Id" src="images/left.gif" onclick="changeState();" alt="关闭/打开左栏" border="0" />
</center>
<table height="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td height="100%" style="width: 9px; vertical-align: middle; text-align: center;" >
<img id="image1Id" src="images/left.gif" onclick="changeState();" alt="关闭/打开左栏" border="0" />
</td>
</tr>
</tbody>
</table>
</div>
<!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>Untitled Page</title>
<style>
html,body,form,table,div{height:100%}
</style>
</head>
<body style="background-color:Blue;">
<form id="form1" runat="server">
<div>
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="width: 9px; vertical-align: middle; text-align: center;">
<img id="image1Id" src="images/left.gif" onclick="changeState();" alt="关闭/打开左栏" border="0" />
</td>
</tr>
</tbody>
</table>
</div>
</form>
</body>
</html>
html,body,form,table,div{height:100%}
</style>加上这个后,出现下拉条了
仅仅设置body,别的不应该。
<style>
body{height:100%}
</style>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
把这句话注释掉你的烦恼就解除了
wartim
我是IE6,为什么我每次点击全是这一个图呢?
要不显示滚动条这样就可以 <style>
html,body,form,table,div{height:100%;margin:0;padding:0}
</style>
删除
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
是不合理的不学会使用
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
你以后会很麻烦的
<title>Untitled Page</title>
<style>
html,body,form,table,div{height:100%; overflow-y:hidden;}
</style>
<style>
html,body,form,table,div{height:100%;margin:0;padding:0}
</style>
用这个出现下拉条.也不显示出来,去掉那个就可以正常显示.还请老大指点!