如何防止这个 flex parent 缩小到小于 children 的高度?灰色容器是 flex 父容器,白色框是子容器。
grey box
display flex
white boxes
display block
height 200px
最佳答案
我发现了问题;它是由使用以下规则重置的 css 引起的:
body, html { height: 100%; }
一旦我将其更改为:
,问题就消失了body { height:auto; min-height:100%; }
html { height: 100%; }
关于html - Flexbox parent 收缩得比 children 小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27131855/