2

I need something looking very common:

+-----------+
|  Header   |
+-----------+
|          ^|
|          ||
|  Scroll  ||
|          ||
|          v|
+-----------+
|  Footer   |
+-----------+

But the problem is, that my header can wrap, and so its height can change. So I can not use position: absolute to layout page and any other where header size is fixed and known a priori. I designed one solution using display: table, but it looks different in every browser, and only works as expected in Chrome.

What would I need to do to adapt this for FF and IE9?

link (working in chrome only)

Here is picture in order: FF, IE, Chrome (ok)

enter image description here

My version: FF (20.0.1), IE (9.0.8112.16421 64bit), Chrome (26.0.1410.64 m)

Troy Alford
  • 26,660
  • 10
  • 64
  • 82
Saram
  • 1,500
  • 1
  • 18
  • 35
  • This question may be of interest, but Flexbox requires IE10+: http://stackoverflow.com/questions/14962468/flexbox-and-vertical-scroll-in-a-full-height-app-using-newer-flexbox-api. You'll get exactly what you want in most browsers if you can live without scrolling in those that don't support it. – cimmanon Apr 23 '13 at 12:23
  • @cimmanon this is perfect... but i need IE9 :( – Saram Apr 23 '13 at 13:00
  • Yeah, it would be simple if you could have [a fixed height of header](http://pastebin.com/z08LjVLh) via absolute position, but now it is quite a riddle.... – Stano Apr 23 '13 at 19:32

2 Answers2

0

You want overflow-y: scroll.

Working example:

Demo

Alp
  • 29,274
  • 27
  • 120
  • 198
0

Add overflow-y:scroll to your content div for scroll and max-height to header. This may be help to your query: see here: fiddle

.header{
    max-height: 100px;
}
.content {
  height: 400px;
  background-color: yellow;
  overflow-y: scroll;
}
Pramod Bhoi
  • 197
  • 1
  • 7