gpt4 book ai didi

html - IE Flexbox - 在父元素上使用最小高度时,子元素不会拉伸(stretch)

转载 作者:太空宇宙 更新时间:2023-11-04 03:11:48 25 4
gpt4 key购买 nike

请看这支笔:

http://codepen.io/anon/pen/ZYZLMG

它应该做的是让红色的 .section 元素填充蓝色的 .container 元素。它适用于 Chrome 和 FF,但不适用于 IE。

当设置 height 而不是 min-height 时,它可以工作,但我需要 min-height 因为包含的元素可能超过 thus增加容器的大小。

有没有办法让它发挥作用?

最佳答案

为了解决这个问题,我需要将 min-height 元素包装在另一个 flexbox 行中。

http://s.codepen.io/boomerang/cf5b323f92549ea4b9e9aa3afcee9fc41427899803437/index.html#https://github.com/philipwalton/flexbugs#3-min-height-on-a-column-flex-container-wont-apply-to-its-flex-items

不漂亮,因为我必须为“样式”添加另一个元素,但它有效。

关于html - IE Flexbox - 在父元素上使用最小高度时,子元素不会拉伸(stretch),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29393846/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com