<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
>
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head >
< title > 网页自动适应浏览器 </ title >
</ head >
< body style ="margin: 0px;" onResize ="setHeight()" onLoad ="setHeight()" >
< div id ="div1" style ="background-color: Red;" >
</ div >
< script type ="text/javascript" >
function setHeight()
{
document.getElementById( " div1 " ).style.height = document.body.clientHeight;
}
</ script >
</ body >
</ html >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head >
< title > 网页自动适应浏览器 </ title >
</ head >
< body style ="margin: 0px;" onResize ="setHeight()" onLoad ="setHeight()" >
< div id ="div1" style ="background-color: Red;" >
</ div >
< script type ="text/javascript" >
function setHeight()
{
document.getElementById( " div1 " ).style.height = document.body.clientHeight;
}
</ script >
</ body >
</ html >