You will probably get more control of layout using grid rather than flex.
With grid you can specify which column an item is to go in. You can also specify that the system is to use the first available cell to put an item in (using 'dense') so the grid can be filled up even though you are putting the first item into the third cell.
This snippet uses the code you have given but as pure HTML/CSS.
It has a media query at 600px which of course can be altered as required. At that point it sets the grid to have 2 columns instead of 3.
发布评论
评论(1)
使用网格而不是Flex,您可能会获得更多对布局的控制。
使用网格,您可以指定要进入哪一列的列。您还可以指定系统使用第一个可用的单元格将项目放入(使用“密度”),以便即使您是,也可以填写网格将第一项放入第三个单元格。
该片段使用您给出的代码,但作为纯HTML/CSS。
它的媒体查询为600px,当然可以根据需要更改。那时,它将网格设置为具有2列而不是3列。
通过使用GAP满足50px的要求。
You will probably get more control of layout using grid rather than flex.
With grid you can specify which column an item is to go in. You can also specify that the system is to use the first available cell to put an item in (using 'dense') so the grid can be filled up even though you are putting the first item into the third cell.
This snippet uses the code you have given but as pure HTML/CSS.
It has a media query at 600px which of course can be altered as required. At that point it sets the grid to have 2 columns instead of 3.
The 50px requirement is met by using gap.