前端 - 关于一个响应式的布局的问题?
迷茫
迷茫 2017-04-17 12:08:35
0
13
984

一个页面,一行放5个元素(横向布局)。
1,怎样让这些元素在页面尺寸不断变小的时候width不变,而之间的margin不断变小。
2,怎样让这些元素在页面尺寸不断变小的时候width变小,而之间的margin不变呢。

我以前都是百分比布局,不知这种效果该如何实现?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(13)
PHPzhong

You deserve flex layout

洪涛

One more thing to add, written in JS.

Ty80

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template