首頁  >  文章  >  web前端  >  CSS 網格

CSS 網格

Linda Hamilton
Linda Hamilton原創
2024-11-01 08:22:02114瀏覽

CSS Grid


[CSS(https://developer.mozilla.org/en-US/docs/Web/CSS) property is a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) property that sets all of the explicit and implicit grid properties in a single declaration.


Using

 ```grid```

 you specify one axis using [grid-template-rows](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows) or [grid-template-columns](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns), you then specify how content should auto-repeat in the other axis using the implicit grid properties: [grid-auto-rows](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows), [grid-auto-columns](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns), and [grid-auto-flow](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow).


**Try it**

## CSS Demo: grid
`

```
grid: auto-flow / 1fr 1fr 1fr;
```
`



網格:自動流動密集/40px 40px 1fr;





網格:重複(3, 80px) / 自動流動;


以上是CSS 網格的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn