I am trying to achieve this layout:
- Page is 1200px wide and centered
- Page fills 100% of the browser's height
- Page does not scroll
- The green and red divs should have inline scrolling instead
- Whenever the header (olive, blue, yellow, orange) gets higher, green and red should still fill the page but not more
I have been trying for some time now, but I don't know how to make the green (and red) part take the rest of the page's size. I don't want to use absolute positioning since I need the page to react to the header's dynamic size. Also, I don't really want to use Javascript if possible.
Here's what I've got so far: https://jsfiddle.net/n3uefLmp/
CSS:
html, body {
margin: 0px;
height: 100%;
}
#page {
position: relative;
margin: 0 auto;
width: 1200px;
min-height: 100%;
max-height: 100%;
height: auto !important;
}
#bar1 {
min-height: 40px;
background-color: olive;
}
#bar2 {
width: calc(100% - 175px);
height: 40px;
background-color: blue;
}
#bar3 {
width: calc(100% - 175px);
height: 135px;
overflow: hidden;
background-color: yellow;
}
#rightBox {
position: absolute;
right: 0px;
width: 175px;
height: 175px;
background-color: orangered;
float: right;
}
#left {
background-color: green;
min-height: 100%;
max-height: 100%;
width: 50%;
}
HTML:
<body>
<div id="page">
<header>
<div id="bar1"></div>
<div id="rightBox"></div>
<div id="bar2"></div>
<div id="bar3"></div>
<div style="clear: both;"></div>
</header>
<div id="left">
bla
</div>
</div>
</body>
Any ideas on how I could achieve that layout using pure html/css?
Thanks!