grid容器
grid-template-columns/rows 生成单元格
<div class="container">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
grid-template-columns: 10em 10em 10em;
grid-template-rows: 10em 10em 10em;
![](https://img.php.cn/upload/image/781/747/487/1657781659855800.png)
移动 单元格 到指定位置
.container > .item:first-of-type{
background-color: bisque;
grid-row: 2 /3;
grid-column: 2 /4;
}
![](https://img.php.cn/upload/image/159/363/687/1657782030831238.png)
grid-area
grid-area: 2 / 2 / span 3 / span 2;
![](https://img.php.cn/upload/image/436/779/238/1657782677523676.png)
grid-auto-flow
grid-auto-flow: row;
grid-auto-flow: column;
列
![](https://img.php.cn/upload/image/330/938/143/1657782987104595.png)
行
![](https://img.php.cn/upload/image/319/668/701/1657783000133659.png)
grid-auto-rows
自动 设置大小
grid-auto-rows: 10em;
![](https://img.php.cn/upload/image/285/431/631/1657783356411301.png)
gap
设置行列间距
gap:1em;
![](https://img.php.cn/upload/image/601/196/887/1657783489689801.png)
place-content
剩余空间排列
place-content:start right;
![](https://img.php.cn/upload/image/902/581/609/1657783840738575.png)
place-items
网络 单元格 对齐
place-items: start right;
![](https://img.php.cn/upload/image/128/745/456/1657784113445724.png)
place-self
指定对齐
place-self:end right;
![](https://img.php.cn/upload/image/918/813/295/1657784415532309.png)