div 自适应用这句话:
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div><!--here-->
iframe自适应用这句话:
<iframe name="right" id="right" enableviewstate="true" style="text-align:center;" src="main_right.aspx" width="100%" height="100%" frameborder="0" scrolling="no" onLoad="iFrameHeight()" > </iframe>
在脚本加入
<script type="text/javascript" language="javascript">
function iFrameHeight() {
var ifm= document.getElementById("right");
var subWeb = document.frames ? document.frames["right"].document : ifm.contentDocument;
if(ifm != null && subWeb != null) {
ifm.height = subWeb.body.scrollHeight;
}
}
</script>