What are the differences between flex-basis and width?

后端 未结 5 1681
Happy的楠姐
Happy的楠姐 2020-11-21 05:47

There have been questions and articles about this, but nothing conclusive as far as I can tell. The best summary I could find is

flex-basis a

5条回答
  •  [愿得一人]
    2020-11-21 06:11

    Possibly the most important point to add:

    What if the browser doesn't support flex? In such a case, width/height take over and their values apply.

    It is a very good idea - almost essential - to define width/height on elements, even if you then have a completely different value for flex-basis. Remember to test by disabling display:flex and seeing what you get.

提交回复
热议问题