Visual grid layout designer with drag-to-create areas and CSS export
Click and drag on the grid below to create named areas, or use the preset layouts above.
CSS Grid is a two-dimensional layout system that allows you to create complex layouts with rows and columns.
Key advantages:
Example: repeat(3, 1fr) creates three equal columns
Example: 200px 1fr 2fr creates fixed first column, flexible others
Named areas let you define layout visually in CSS:
grid-template-areas:
"header header header"
"sidebar main main"
"footer footer footer";
Then assign items to areas:
.header { grid-area: header; }
.sidebar { grid-area: sidebar; }
Rules: Areas must be rectangular, use dots (.) for empty cells
Auto-fit responsive grid:
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
Creates columns that are at least 250px, wrapping to new rows as needed.
Media query approach:
/* Mobile */
grid-template-columns: 1fr;
/* Tablet */
@media (min-width: 768px) {
grid-template-columns: repeat(2, 1fr);
}
/* Desktop */
@media (min-width: 1024px) {
grid-template-columns: repeat(3, 1fr);
}
Use Grid for:
Use Flexbox for:
Best practice: Use both! Grid for page layout, Flexbox for components.