- Home
- /
- Tutorials
- /
- CSS Tutorial
- /
- CSS Grid Container
CSS Grid
CSS Grid Container
A CSS Grid Container is an HTML element that uses the CSS Grid Layout system to arrange its child elements in rows and columns.
CSS Grid is a powerful two-dimensional layout system that allows you to control both: The supporting concepts are explained in CSS Grid Columns and CSS Grid Rows.
- Rows
- Columns
Unlike Flexbox, which primarily works in one direction (row or column), CSS Grid can manage both directions simultaneously.
Grid Layout is commonly used for:
- Website layouts
- Dashboards
- Image galleries
- Product grids
- Responsive designs
Syntax
To create a grid container, use the display: grid; property.
CSS Grid Container Syntax
css
.container {
display: grid;
}