0

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.

Andreas Louv
  • 46,145
  • 13
  • 104
  • 123
Surjith SM
  • 1
  • 1
  • 2
  • See this existing [StackOverflow answer](http://stackoverflow.com/questions/1095563/how-can-i-make-a-div-adopt-the-height-of-the-screen) – My Head Hurts Jul 13 '11 at 09:31

2 Answers2

3

set width 100%; It's works

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

#wrapper {
width:100%;
background:#ccc;
}
Mr.T.K
  • 2,318
  • 6
  • 26
  • 42
1

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?

nourdine
  • 7,407
  • 10
  • 46
  • 58