如何让页面 不出现 滚动条

夏虫1 2009-09-10 01:45:54
我的代码如下:
并且不想用 frame 和 frameset
如何让页面 不出现 滚动条
并且
topDiv 占67px
middleDiv 占余下的
footDiv占 20px



怎么写啊
<!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>
...全文
1738 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
浴火_凤凰 2009-09-17
  • 打赏
  • 举报
回复
在body里加
<body scroll="no"> </body>
夏虫1 2009-09-17
  • 打赏
  • 举报
回复
还是10楼理解最正确。要是能通过纯CCS搞定就完美了
javaie 2009-09-17
  • 打赏
  • 举报
回复
<body scroll="no"> </body>
lalaguan 2009-09-16
  • 打赏
  • 举报
回复
10楼正解,取clientHeight,再减去另两个值就是了
我咧个去 2009-09-16
  • 打赏
  • 举报
回复
把boddy定义固定高度就行了。
yuanhu8688 2009-09-16
  • 打赏
  • 举报
回复
<style type="text/css">
html{
overflow:hidden;
}
</sytle>
飞起来一脚 2009-09-16
  • 打赏
  • 举报
回复
<!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>
jsuzzy 2009-09-15
  • 打赏
  • 举报
回复
现在滚动条出现,是因为67px+20px=87px,87px大于屏幕的10%的高度。
如果不想出现滚动条,可以把middleDiv的90%改小一些,然后加上overflow:hidden;
flyerwing 2009-09-15
  • 打赏
  • 举报
回复

<body scroll="no"> </body>

如果不是BODY的,
那么就用属性
overflow(-x,-y):hidden;
动感晴 2009-09-14
  • 打赏
  • 举报
回复
<frameset cols="30%,30%,*" border="0">
<frame name="frame1" src="a.html" noresize >
<frame name="frame2" src="a.html">
<frame name="frame3" src="b,html">
</frameset>
noresize 就是禁用滚动条的,上面的数字你调一下就可以了
edielei 2009-09-12
  • 打赏
  • 举报
回复

<style type="text/css">
html{
overflow:hidden;
}
</sytle>
夏虫1 2009-09-12
  • 打赏
  • 举报
回复
各位老大们还不清楚我在与什么,#middleDiv这个css应该怎么写才能让高度正好承满,又没有滚动条
BeenZ 2009-09-10
  • 打赏
  • 举报
回复

在body里加
<body scroll="no"> </body>
xuStanly 2009-09-10
  • 打赏
  • 举报
回复
google:css div 高度自适应
http://www.blueidea.com/tech/web/2006/3210.asp
jayqean 2009-09-10
  • 打赏
  • 举报
回复
<body scroll="no"> </body>
琥珀明月 2009-09-10
  • 打赏
  • 举报
回复
overflow:hidden;

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧