How to force flex children not to overflow the container?

后端 未结 4 736
我寻月下人不归
我寻月下人不归 2021-02-05 22:56

Given a flexbox container, how could I make sure that, if children have lots of content, they don\'t overflow the container?

4条回答
  •  北荒
    北荒 (楼主)
    2021-02-05 23:08

    Using min-height: 210px; instead of explicitly setting a height on your container gives you the desired affect by letting an extra long child to extend its height.

    Also, great question writing! Nice to see diagrams of whats happening vs expected, ect.

提交回复
热议问题