首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Flexbox:自动溢出和窗口大小

Flexbox:自动溢出和窗口大小
EN

Stack Overflow用户
提问于 2017-05-21 06:37:31
回答 1查看 52关注 0票数 0

下面的代码演示了我遇到的问题。当我缩小浏览器窗口的高度时,窗口包装器不会随着主包装器一起缩小。

谁能告诉我,当主包装器遵循浏览器大小时,我遗漏了什么,不允许窗口包装器收缩(高度)?

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

发布于 2017-05-21 06:44:02

从#window-wrapper中删除width: 100%;属性。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44091445

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档