Following to this answer, I am trying to create a perfect height for my content, But the content height is overflowing instead of getting a scroll over content. I have created a fiddle for this scenario. Please help me fix my content height such a way that top content and always visible and scroll-able downward.
html,
body {
    height: 100%;
    margin: 0
}
.box {
    display: flex;
    flex-flow: column;
    height: 100%;
}
.box .row {
    border: 1px dotted grey;
}
.box .row.header {
    flex: 0 1 auto;
}
.box .row.content {
    display: flex;
    flex-flow: column;
    flex: 1 1 auto;
    overflow-y: auto;
    justify-content: center;
    align-items: center;
}
.data {
    width: 80%;
    min-height: 400px;
}
.box .row.footer {
    flex: 0 1 40px;
}
HTML.
<head>
    <link href="./test.css" rel="stylesheet">
</head>
<body>
    <div class="box">
        <div class="row header">
            <p>
                <b>header</b>
                <br />
                <br />(sized to content)</p>
        </div>
        <div class="row content">
            <div class="data">
                invisible box1
            </div>
            <div class="data">
                visible box2
            </div>
            <div class="data">
                visible box3
            </div>
            <p>
                <b>Bottom Box is visible with scroll.</b> (fills remaining space)
            </p>
        </div>
        <div class="row footer">
            <p>
                <b>footer</b> (fixed height)</p>
        </div>
    </div>
</body>
</html>
 
     
    