div如何自适应高度和宽度

Linient 2009-02-24 10:05:33
如何让两个div并排显示,并且布满整个屏幕呢?我现在是固定好两个div的宽度,可是这样根本就没有自适应高度和宽度。我的代码如下
<div id="pop" style="position: absolute; width:200px; height: 670px; border: 1px solid #7F9DB9; background-color: #ffffff; left:3px; top: 3px; z-index:1; position:absolute;">

<div style="height: 30px;">
<table width="100%" align="center" border="0" cellspacing="0">
<tr>
<th background="../images/table.jpg" style="color: #205397; padding-left:10px"
align="left" height="30">
控告案由
</th>
</tr>
</table>
</div>
<div class="dtree" style="overflow:scroll; width:200px; height:640; border-bottom: 1px solid #7F9DB9;">
<%-- START JAVASCRIPT显示组织结构 START --%>
<script type="text/javascript">
KgaydTree = new dTree('KgaydTree');
KgaydTree.add(0,-1,'控告案由分类');
<logic:iterate id="listKgayb" name="listKgayb">
KgaydTree.add('${listKgayb.bh}','${listKgayb.kgayb.bh}','(${listKgayb.bh})${listKgayb.kgaymc}','javascript:setKgayValue(\'${listKgayb.bh}\')');
</logic:iterate>
document.write(KgaydTree);
</script>
</div>
</div>



<div id="pop2" style="background-color: #ffffff; position: absolute; width:570px; height:670px; border: 1px solid #7F9DB9; left: 203px; top: 3px; z-index:1">

<div style="height: 30px; width: 570px; background:url(../images/table.jpg)"></div>



<div
style="overflow: auto; height: 640px; width: 570px; border-bottom: 1px solid #7F9DB9;">
<table id="kgaylb" width="568px" border="1" bgcolor="#EAF1FB" align="center" cellspacing="0" bordercolor="#D6DFE9">

<tr style="color: #555">
<td width="100" height="30">
案由编码
</td>
<td width="300" >
案由名称
</td>
<td width="168" >
所属案由
</td>
</tr>
</table>
<input type="hidden" name="maxrow" id="maxrow">
<input type="hidden" name="judge" id="judge">
</div>
</div>
...全文
561 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunboard 2009-02-26
  • 打赏
  • 举报
回复
用百分率来表示 宽和高,基础的基础啊。。。。
roonten 2009-02-26
  • 打赏
  • 举报
回复
哎,没分

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧