<body style="height:100px;margin:0px">
<div id="d1">
<input type="text" value="hello" />
</div>
<div id="d2" style="height:200px;background-color:blue;"></div>
<div id="d3" style="background-color:red"></div>
</body>
<script>
window.onload = function () {
var css1 = document.compatMode == 'CSS1Compat';
var h = document[css1 ? 'documentElement' : 'body'].clientHeight;
var d1 = document.getElementById('d1'), d2 = document.getElementById('d2'), d3 = document.getElementById('d3')
d3.style.height = h - d1.offsetHeight - d2.offsetHeight+'px';
}
</script>
<div id="d1">
<input type="text" value="hello" />
</div>
<div id="d2" style="height:200px;background-color:blue;"></div>
<div id="d3" style="background-color:red"></div>
</body>
<script>
window.onload = function () {
var css1 = document.compatMode == 'CSS1Compat';
var h = document[css1 ? 'documentElement' : 'body'].clientHeight;
var d1 = document.getElementById('d1'), d2 = document.getElementById('d2'), d3 = document.getElementById('d3')
d3.style.height = h - d1.offsetHeight - d2.offsetHeight+'px';
}
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货