🔄

flex和inline-flex的区别

💡
Notion Tip: This page documents processes product managers should follow to ship features at Acme Corp. Helpful for getting new employees up to speed.
两者的区别描述:
  • flex: 将对象作为弹性伸缩盒显示
  • inline-flex:将对象作为内联块级弹性伸缩盒显示
一句话来描述就是 当Flex Box 容器没有设置宽度大小限制时,当display 指定为 flex 时,FlexBox 的宽度会填充父容器,当display指定为 inline-flex 时,FlexBox的宽度会包裹子Item,如下图所示:
notion image