61,112
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head>
<title>无标题页</title>
<style type="text/css">
html,body,.wrap {height:100%;margin:auto;}
#topDiv{height:67px;background:red;}
#middleDiv{height:90%;background:green;}
#footDiv{height:20px;background:red;}
</style>
</head>
<body>
<div class= "wrap">
<div id= "topDiv" class="top"> fgfgfg </div>
<div id= "middleDiv" class="middleWrap"> gggg
<div class="left"> </div>
<div class="right"> </div>
</div>
<div id="footDiv" class="foot"> gggg </div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head>
<title>无标题页</title>
<style type="text/css">
html,body,.wrap {height:100%;margin:auto;}
#topDiv{height:67px;background:red;margin-bottom:0px}
#middleDiv{margin:0;background:green;}
#footDiv{height:20px;background:red;margin-bottom:0px;}
</style>
</head>
<body>
<div class= "wrap">
<div id= "topDiv" class="top"> fgfgfg </div>
<div id= "middleDiv" class="middleWrap"> gggg
<div class="left"> </div>
<div class="right"> </div>
</div>
<div id="footDiv" class="foot"> gggg </div>
</div>
</body>
</html>
<script>
w=document.documentElement.clientHeight;
document.getElementById("middleDiv").style.height=eval(eval(w)-67-20);
</script>
<body scroll="no"> </body>
如果不是BODY的,
那么就用属性
overflow(-x,-y):hidden;
<style type="text/css">
html{
overflow:hidden;
}
</sytle>
在body里加
<body scroll="no"> </body>