flex not working to make design responsive

99封情书 提交于 2020-01-25 07:27:06

问题


I am using React Material components in my application, to make it responsive to various screen sizes i am trying to use flex. Below is my code

<div style={{ display: 'flex', flexWrap: 'wrap', flexWrap: "wrap" }}>
     <div style={{ flexGrow: 1, flexBasis: "25%" }}>
      <Chip />
     </div>
    <div style={{ flexGrow: 1, flexBasis: "25%" }}>
      <Chip />
     </div>
   <div style={{ flexGrow: 1, flexBasis: "25%" }}>
      <Chip />
    </div>
   <div style={{ flexGrow: 1, flexBasis: "25%" }}>
      <Chip />
   </div>
 </div>

In the above code Chip is a component from Material Ui. The above code does not make the chips go down (responsive) as the screen size reduces. What's wrong?

来源:https://stackoverflow.com/questions/59141764/flex-not-working-to-make-design-responsive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!