一个页面,一行放5个元素(横向布局)。
1,怎样让这些元素在页面尺寸不断变小的时候width不变,而之间的margin不断变小。
2,怎样让这些元素在页面尺寸不断变小的时候width变小,而之间的margin不变呢。
我以前都是百分比布局,不知这种效果该如何实现?
PHP中文网2017-04-17 12:10:35
You should make the percentage grid a separate container, and place the list items inside the grid, then fix the width of its internal infrastructure. The margin will naturally change with the change of the large container, otherwise the spacing will be fixed. Then everything is solved, no need for flex layout or anything like that