1fr — one fractional unit of remaining space
auto — size to content
minmax(min,max) — flexible min/max bounds
repeat(n, val) — repeat a track definition
Design modern, responsive layouts effortlessly using our CSS Grid Generator. This visual tool allows you to create CSS Grid layouts without manually writing complex CSS. Configure columns, rows, gaps, alignment, and item placement while seeing your layout update instantly. Once you're satisfied with the design, copy the generated CSS and use it directly in your website or web application.
CSS Grid is one of the most powerful layout systems available in modern CSS. It gives developers complete control over both rows and columns, making it ideal for responsive web pages, dashboards, landing pages, image galleries, admin panels, and complex application layouts. Our generator simplifies the entire process with an intuitive visual interface.
1fr 2fr 1fr or repeat(4,100px).Defines the number and width of grid columns. Use fractional units, fixed widths, percentages, or repeat() to build flexible layouts.
grid-template-columns: 1fr 2fr 1fr;
Controls the height of each grid row. Rows can use fixed values, percentages, auto sizing, or repeat() functions.
grid-template-rows: repeat(4,100px);
Sets the vertical spacing between rows inside the grid container.
row-gap:20px;
Controls the horizontal spacing between columns.
column-gap:16px;
Aligns every grid item horizontally inside its own grid cell.
Controls vertical alignment of items inside their individual grid cells.
Position individual items anywhere within the grid by specifying their starting and ending rows and columns. This makes it easy to create magazine layouts, dashboards, hero sections, sidebars, and other advanced page structures.
.item-1{
grid-column:1 / 3;
grid-row:1 / 3;
}
.container{
display:grid;
grid-template-columns:1fr 2fr 1fr;
grid-template-rows:repeat(4,100px);
row-gap:10px;
column-gap:12px;
justify-items:center;
align-items:stretch;
}
The fractional unit distributes available space proportionally between grid columns and rows.
Quickly repeat identical track sizes without manually writing each value.
repeat(4,1fr)
Automatically sizes rows or columns based on their content.
Creates responsive tracks with minimum and maximum size limits.
minmax(200px,1fr)