网页自动适应浏览器

 

<!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>

posted on 2007-08-14 17:57  廖勇军  阅读(371)  评论(0编辑  收藏  举报

导航