flex布局下width和height不起作用

2023-02-14  本文已影响0人  小豆soybean

display: flex 在父元素上 也改变了 widthheight 的工作方式。通过 flex: 0 0 auto; 禁用收缩/增长,或使用 min-widthmax-width 代替。

width 和 height 在这种情况下基本上失去了原来的意义,将充当 flex-basis ,参见 geddski:The Difference Between Width and Flex Basis

上一篇 下一篇

猜你喜欢

热点阅读