如何设置div的高度与屏幕高度相同 [英] How to Set Height of a div same as the Screen Height

查看:475
本文介绍了如何设置div的高度与屏幕高度相同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果屏幕尺寸改变,我需要一个div高度可以改变。



我还需要div是可滚动的,因为内容可能很大。
$ b $



也应该在IE6上工作




如果是,请输入完整的css,html和javascript。


div class =h2_lin>解决方案

设置宽度100%;它的工作

  body {
width:100%;
height:100%;
}

#wrapper {
width:100%;
background:#ccc;
}


I need a div height changable if the screen size changes.

I also need that div is scrollable because the content may be Large.
But only when it is larger than the screen zize.

Also it should Work on IE6

Is there any Possibility for that?

If yes,
Please Give me the Complete css, html and javascript.

解决方案

set width 100%; It's works

body {
width:100%;
height:100%;
}

#wrapper {
width:100%;
background:#ccc;
}

这篇关于如何设置div的高度与屏幕高度相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆