after researching the flexible box model for a whole day, I must say I really like it. It implements the functionality I implement in JavaScript in a fast and clean way. One
since there is some interest in this question, I will give you the current solution I found. It's test in chrome (no other browser currently working with this sample, but got another bigger on working in FF which somehow doesn't work when I "simplyfy it"...).
The idea behind it is, to somehow make the element nested inside the flexible box extend to the full size of the flexible box element. To do so an absolut position element is added inside, which has 0 distance to the left, right, top and bottom.
However, even in Chrome, there is an error, when downsizeing and resizing the element so that the scrollbar disapears.
Here is the html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>flexbox example - 2 column layout</title>
<meta name="author" content="Gwilym Johnston">
<style type="text/css">
html, body{
height: 100%;
margin: 0px;
}
#box-orient-example {
-moz-box-orient: horizontal;
-webkit-box-orient: horizontal;
-ms-box-orient: horizontal;
box-orient: horizontal;
display: -moz-box;
display: -webkit-box;
display: -ms-box;
display: box;
height: 100%;
overflow: auto;
}
#box1 {
-moz-box-flex: 1;
-webkit-box-flex: 1;
-ms-box-flex: 1;
background: none repeat scroll 0 0 lightblue;
text-align: center;
overflow: auto;
position: relative;
}
#box2 {
-moz-box-flex: 1;
-webkit-box-flex: 1;
-ms-box-flex: 1;
background: none repeat scroll 0 0 #DDDDDD;
text-align: center;
overflow: auto;
position: relative;
}
.abs {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
}
.rel{
position: relative;
}
</style>
</head>
<body>
<div id="box-orient-example" class="example">
<div id="box1">
<div class="abs">
<div class="rel">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</div>
</div>
</div>
<div id="box2">
<div class="abs">
<div class="rel">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
</div>
</div>
</div>
</body>
</html>
I've been wrestling with this myself, but have finally managed to come up with a solution.
See this jsFiddle, although I have only added webkit prefixes so open in Chrome.
You basically have 2 issues which I will deal with separately.
position:relative;
on the parent of the child. position:absolute;
on the child.overflow-y:auto;
on the scrollable div. height:0;
See this answer for more information on the scrolling issue.
You must also make the div you want to expand a flex-box as well and add a flex value. This fixes the problem.
#fullsize{
background-color: red;
display: -webkit-box;
display: box;
display: -moz-box;
box-flex:1;
-webkit-box-flex:1;
-moz-box-flex:1;
}