当前位置:编程学习 > C#/ASP.NET >>

frameset 高度的问题。·

让frameset适应各种屏幕高度...愁了.`

发个首页的框架.



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<title>通用后台管理系统</title>
</head>
<frameset rows="50,*" cols="*" frameborder="no" border="0" framespacing="0">
  <frame src="topframe.html" name="topFrame" frameborder="no" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
  <frameset name="myFrame" cols="199,7,*" frameborder="no" border="0" framespacing="0">
    <frame src="leftframe.html" name="leftFrame" frameborder="no" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame" />
<frame src="switchframe.html" name="midFrame" frameborder="no" scrolling="No" noresize="noresize" id="midFrame" title="midFrame" />
    <frameset rows="59,*" cols="*" frameborder="no" border="0" framespacing="0">
         <frame src="nav.html" name="mainFrame" frameborder="no" scrolling="No"  noresize="noresize" id="mainFrame" title="mainFrame" />
         <frame src="manframe.html" name="manFrame" frameborder="no" id="manFrame" title="manFrame" />
     </frameset>
  </frameset>
</frameset>
<noframes><body>
</body>
</noframes>
</html>


--------------------编程问答-------------------- 你现在哪里不对? --------------------编程问答--------------------
引用 1 楼  的回复:
你现在哪里不对?


不适应高度。高度是固定的。
我现在也在调。 --------------------编程问答-------------------- 如果对宽或者高没有分的时候就不要写相应的属性。
比如我分上下就只写rows不写cols,反之也是一样。
在frame里面的页面body{}这里面不要设置height这个属性,那么高度会自适应。
 <frameset rows="59,*" cols="*" frameborder="no" border="0" framespacing="0">
         <frame src="nav.html" name="mainFrame" frameborder="no" scrolling="No"  noresize="noresize" id="mainFrame" title="mainFrame" />
         <frame src="manframe.html" name="manFrame" frameborder="no" id="manFrame" title="manFrame" />
     </frameset>
这里再分上下,cols就不用设置哦 --------------------编程问答--------------------
引用 3 楼  的回复:
如果对宽或者高没有分的时候就不要写相应的属性。
比如我分上下就只写rows不写cols,反之也是一样。
在frame里面的页面body{}这里面不要设置height这个属性,那么高度会自适应。
 <frameset rows="59,*" cols="*" frameborder="no" border="0" framespacing="0">
  <frame src="nav.htm……



那像这种结构可以改成适应的不?我现在想 用JS重新赋值高度。 --------------------编程问答-------------------- 我用的frameset没有碰见你说的问题。
至于js赋值高度可以用,但是能够用css实现的最好不要去用js做 --------------------编程问答-------------------- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用户管理后台</title>
</head>
<frameset rows="116,*" frameborder="0" framespacing="0"> 
<frame id="HeadFrame" name="HeadFrame"  scrolling="no" frameborder="0" src="../UserManager/Hearder.aspx" marginwidth="0" marginheight="0"/>
<frameset cols="235,*" frameborder="1" border="2" bordercolor="#A1C7F9" framespacing="2" id="slider_content"> 
    <frame id="NavigetionFrame" name="NavigetionFrame"  scrolling="no" frameborder="1" src="../UserManager/Menu.aspx" marginwidth="0" marginheight="0" />
    <frame id="ContentFrame" name="ContentFrame" src="HomePage.htm" frameborder="1" marginwidth="0" marginheight="0" scrolling="Auto"/>
</frameset> 
</frameset>
<noframes><body></body></noframes>
</html>

你看下我这个。就是屏幕自适应的
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,