Home  >  Article  >  Web Front-end  >  CSS Grid

CSS Grid

Linda Hamilton
Linda HamiltonOriginal
2024-11-01 08:22:02114browse

CSS Grid

The

[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;
```
`



grid: auto-flow dense / 40px 40px 1fr;





grid: repeat(3, 80px) / auto-flow;


The above is the detailed content of CSS Grid. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn