<!-- flex -->
.template-container {
display: flex;
justify-content: space-between;
align-content: flex-start;
flex-wrap: wrap;
}
.template-container::after {
content: "";
flex: auto; /* 或者flex: 1 */
}
<!-- grid -->
.template-container {
display: grid;
justify-content: space-between;
grid-template-columns: repeat(auto-fill, 200px);
grid-auto-rows: 200px;
grid-gap: 20px;
.template-item {
width: 200px;
height: 100px;
border: 1px solid #000;
}
}
flex/grid布局,左对齐
于 2021-12-13 10:40:20 首次发布