参见英文答案 > Chrome / Safari not filling 100% height of flex parent 4个
另一个Flex容器内的FlexBox列容器在Chrome中不会达到100%的高度,但在Firefox和Edge中都可以.
.container {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
.inside-container {
display: flex;
flex-direction: column;
height: 100%;
}
}
最佳答案
您错过了父级元素的高度:100%:< header>
添加后,布局也适用于Chrome.
header {
min-height: 100%;
width: 100%;
height: 100%; /* NEW */
}
使用百分比高度时,Chrome要求每个父元素都具有已定义的高度.更多细节在这里:
> Working with the CSS height
property and percentage values
原文地址:https://www.jb51.cc/css/426960.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。