0

The code below demonstrates the issue I am having. When I shrink the browser window in height, the window wrapper is not shrinking with the master wrapper.

Can someone tell me what I am missing that is not allowing the window wrapper to shrink up (height) when the master wrapper is following the browser size?

<STYLE>

html, body, .viewport {
    width: 100%;
    height: 100%;
    margin: 0;
}
/* WRAPPERS */

#master-wrapper {
    width: 100%;
    height: 100%;
    min-width: 800px;
    min-height: 500px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-size: 1em;
    display: flex;
    flex-direction: column;
    flex: auto;
    border-style:solid;
    border-width:5px;
}
#window-wrapper {
    background-color:#ffffff;
    border-style:solid;
    border-width:5px;
    margin:30px;
    width: 100%;
    display-flex;
    flex-grow:1;
}
#page-head {
    width: 90%
    margin-top:12px;
    width:600px;
    margin-top:10px
    margin-bottom:10px;
    margin-right:auto;
    margin-left:auto;
    text-align:center;
    border-style:solid;
    border-width:5px;
}
#nav-bar-wrapper {
    vertical-align: top;
    text-align: left;   
}
#nav-bar{
    margin:10px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    align-content: center;
    top: 0;
    border-style:solid;
    border-width:5px;   
}
#area-wrapper {
    vertical-align: top;
    min-height: 300px;
    max-height: 800px;
    margin:20px;
    text-align: left;
    border-style:solid;
    border-width:5px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: auto;
}
#area-header {
    height: 30px;
    line-height: 30px;
    text-align: center;
    margin-left: 30px;
    margin-right: 30px;
    margin-top: 15px;
    flex-direction: column;
    font-size: 1em;
    border-style:solid;
    border-width:5px;   
}
#area-section {
    vertical-align: top;
    text-align: left;
    margin-left: 25px;
    margin-right: 25px;
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    flex-wrap: wrap;
    justify-content: space-around;

#row {
    text-align:middle;
    margin:75px;
}
#bottom-wrapper {
    height: 40px;
    margin-top:15px;
    margin-bottom:15px;
    margin-right:auto;
    margin-left:auto;
    border-style:solid;
    border-width:5px;
    font-size:1em;  
    background-color:gray;
}
</STYLE>
<body>
<div id="master-wrapper">master wrapper
    <div id="window-wrapper">window wrapper
        <div id="page-head">page head
            <div id="nav-bar-wrapper">nav bar wrapper
                <div id="nav-bar">nav bar</div>
            </div>
            <div id="area-wrapper">area wrapper
                <div id="area-header">area header</div>
                <div id="area-section">
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                    <div>"bunch of info"</div>
                </div>
            </div>
        </div>
    </div>
    <div id="bottom-wrapper">
        bottom wrapper
    </div>
</div>
</body>
Tim
  • 273
  • 2
  • 10
  • An initial setting on flex items is `min-height: auto`. This means that an item cannot shrink below the size of its content. That's why `#window-wrapper` cannot shrink in height with `#master-wrapper`. To override the default, apply `min-height: 0` to `#window-wrapper`. – Michael Benjamin May 21 '17 at 01:17
  • Just note that you have various syntax errors in your code. In `#window-wrapper` you have `display-flex`, which is invalid. You also have a few missing semi-colons. Once fixed they also make a difference in the layout. – Michael Benjamin May 21 '17 at 01:40
  • thank you so much Michael. I don't do much front-end work in flexbox and totally forgot I had asked a very similar question a year ago. This solved my problem. Please remove this question since it is a duplicate. – Tim May 21 '17 at 10:40

1 Answers1

-1

Delete the width: 100%; property from #window-wrapper.

  • This does not fix my issue. My issue is with height not width. But thanks all the same. – Tim May 20 '17 at 22:47