首页  >  文章  >  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