【发布时间】:2018-06-01 07:54:43
【问题描述】:
我正在尝试设置元素的样式,使其看起来像这样。 (正方形元素的大小应该都一样)
这是容器和元素的 css 代码:
.container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
height: 400px;
}
.element {
width: 80px;
height: 80px;
background-color: white;
}
【问题讨论】:
-
只需删除 justify-content:space 之间的空格,您就可以在元素周围添加边距。