求高人指点一个网页布局的问题,谁会给谁分 我用的是<div style="position:absolute; left:28%;top:950px; width: 684px;">这样的页面布局,但是数据是动态显示的所以层的高度就不好固定了,现在问题是页脚footer没办法布局了,不好固定,不固定页脚就显示在页面中间,很棘手,请各位大侠帮帮忙啊,先谢谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 页脚一个ID,$("#footer").height("50px"); 在外面加一层用absolute,里面的全部relative position:absolute;用这个层会跑掉 用relative就不好定位了,达不到我要的效果,最外层的我用relative,现在就生最后一个页脚不好定位了 footer所在的div和你这个 div属同级,用float:left接上,2个外面再套一个大的div 假设浮动DIV的ID为cidfooter所在DIV的ID为fidfunction _g(id){return document.getElementById(id)}window.onload=function(){_g("fid").offsetHeight=(parseInt(_g("cid").style.top.replace("px",""))+_g("cid").offsetHeight)+"px";} 更正一下假设浮动DIV的ID为cidfooter所在DIV的ID为fidfunction _g(id){return document.getElementById(id)}window.onload=function(){_g("fid").offsetTop=(parseInt(_g("cid").style.top.replace("px",""))+_g("cid").offsetHeight)+"px";} 把静态HTML贴出来,你这一部分看不出相互之间的关系 静态码是这样的:<body style="text-align: center"><form id="form1" runat="server"><div id="wh" style=" width:1003px; position:relative;"> <table border="0" align="center" cellpadding="0" cellspacing="0" style="width: 778px"> <tr> <td style="width: 100px"> <uc1:Top ID="Top1" runat="server" /> </td> </tr></table> <div id="ddd" style="position:absolute; left:22%;top:423px; width: 782px;"> ***************中间动态显示数据显示的*************************** </div> </div> <div id="bo"> <uc4:Bottom ID="Bottom1" runat="server" /> </div></form></body> <div id="ddd" style="position:absolute; left:22%;top:423px; width: 782px;"> <div id="header" name="header> </div> <div id="dbody" name="dbody"> ***************中间动态显示数据显示的*************************** </div> <div id="footer" name="footer"> </div></div> css的内容自己写,框架就这样。 不用div,用table,这样可以自动伸缩 div也可以自由伸缩我一般不会用table的,机理不一样 可以把div的滚动条属性设成自动。超高后会自动出现滚动条。而不是加高。 服务器发布后错误(如梦进来) DIV 滤镜问题 网站发布的时候提示找不到控件 JavaScript如何调用asp.net服务器控件的属性 大家帮忙看看这个sql语句怎么解决! 100分征.net构建B2B的构想 取DataGrid中DropDownList值的问题 有谁重写过treeView控件 请问如何从ASP.NET 页中通过按钮调用别的页面,常用的有什么方法! 怎样在服务器端编写客户端脚本 小白问个问题:在visual studio2008 新建网页的时候 已经安装的模板中什么都没有 剪裁图片中的一块。为什么总是从左上角开始。如何从指定的点开始?
假设浮动DIV的ID为cid
footer所在DIV的ID为fidfunction _g(id)
{return document.getElementById(id)}window.onload=function()
{
_g("fid").offsetHeight=(parseInt(_g("cid").style.top.replace("px",""))+_g("cid").offsetHeight)+"px";
}
footer所在DIV的ID为fidfunction _g(id)
{return document.getElementById(id)}window.onload=function()
{
_g("fid").offsetTop=(parseInt(_g("cid").style.top.replace("px",""))+_g("cid").offsetHeight)+"px";
}
静态码是这样的:
<body style="text-align: center">
<form id="form1" runat="server">
<div id="wh" style=" width:1003px; position:relative;">
<table border="0" align="center" cellpadding="0" cellspacing="0" style="width: 778px">
<tr>
<td style="width: 100px">
<uc1:Top ID="Top1" runat="server" />
</td>
</tr>
</table> <div id="ddd" style="position:absolute; left:22%;top:423px; width: 782px;">
***************中间动态显示数据显示的***************************
</div>
</div>
<div id="bo">
<uc4:Bottom ID="Bottom1" runat="server" />
</div>
</form>
</body>
<div id="header" name="header>
</div>
<div id="dbody" name="dbody">
***************中间动态显示数据显示的***************************
</div>
<div id="footer" name="footer">
</div>
</div>
css的内容自己写,框架就这样。
我一般不会用table的,机理不一样