开发者

How to Set Height of a div same as the Screen Height

开发者_StackOverflow中文版

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;
}


if the div is a direct child of body than just set height: 100% on both the div and the body. Like this:

body, #your-div-id {
   height: 100%;
}

As far the scrillability is concerned just go:

#your-div-id {
   overflow: auto;
}

Makes sense to you?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜