公司开发的程序需要适应在不同的分辨率下的高度。
使用我使用 Iframe 的 style="height:100%;" 但是没效果 。
Iframe 设置了 高度 100% 是根据外部容器的高度设置的, 所以,首先要设置好 Body 的高度 。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>教员换班</title>
<%@include file="/common/jspi/jsAndCss.jspi"%>
<style type="text/css">
html,body{ height:100%; margin:0px; padding:0px;}
.box{ height:100%; width:100%;}
</style>
</head>
<body>
<div class="box">
<div class="title_table" style="width:96%">
<span>教员换班</span>
</div>
<table cellspacing="0" cellpadding="0" style="width:96%; height:95%;">
<s:form id="querySimulatorTeaForm"
action="simulatorRes/queryForSimulatorStuSimlist.do" method="POST" target="simListFrame">
<tr>
<td align="center" style="width:70%; height:100%;" valign="top">
<table class="table_form" style="width:100%;height:150px;">
<tr>
<td align="center" valign="middle">
<input type="checkbox" id="selall" οnclick="doCheckClick()"/>全选
</td>
</td>
</tr>
</table>
<iframe id="simListFrame" name="simListFrame" src="queryForSimulatorTeaSimlist.do" scrolling="auto" align="top"
style="width: 100%; height:72%;"></iframe>
</td>
</tr>
</s:form>
</table>
</div>
</body>
</html>
这样, 设置好了Iframe 的高度自适应,