1、容器属性
.container {
display: grid;
grid-template-columns: 100px 100px 100px;
grid-template-columns: 33.33% 33.33% 33.33%;
grid-template-columns: repeat(3, 33.33%);
grid-template-columns: repeat(2, 100px 20px 80px);
grid-template-columns: repeat(auto-fill, 100px);
grid-template-columns: 1fr 1fr;
grid-template-columns: 150px 1fr 2fr;
grid-template-columns: 1fr 1fr minmax(100px, 1fr);
grid-template-columns: 100px auto 100px;
grid-gap: 20px 20px;
grid-column-gap: 20px;
grid-template-areas: 'a a a'
'b b b'
'c c c';
grid-auto-flow: column;
grid-auto-flow: rows;
grid-auto-flow: row dense;
grid-auto-flow: column dense;
justify-items: start | end | center | stretch;
align-items: start | end | center | stretch;
justify-content: start | end | center | stretch | space-around | space-between | space-evenly;
align-content: start | end | center | stretch | space-around | space-between | space-evenly;
}
2、项目属性
.item-1 {
grid-column-start: 1;
grid-column-end: 3;
grid-row-start: 2;
grid-row-end: 4;
}
.item {
justify-self: start | end | center | stretch;
align-self: start | end | center | stretch;
}