▦
Websites

CSS Grid: a modern approach to 2D web layouts

27.12.2026
← All articles

CSS Grid is a 2D layout technology. Flexbox is 1D, Grid is 2D. Since 2017 it has changed web design.

Basics

display: grid. grid-template-columns: 1fr 1fr 1fr.

Lines and tracks

Tracks — rows and columns. Lines — borders.

grid-template-columns/rows

200px 1fr 100px — fixed and flexible.

fr unit

fr is a fraction of the remaining space.

repeat

repeat(4, 1fr) — 4 equal columns.

auto-fill/auto-fit

repeat(auto-fill, minmax(200px, 1fr)) — responsive.

grid-column/row

grid-column: 1 / 3 — span 2 columns.

span

span 2 — 2 cells wide.

grid-template-areas

Named areas, visual layout. \"header header\", \"sidebar main\", \"footer footer\".

Mobile responsive

Media queries. grid-template-areas changes.

Product grid example

repeat(auto-fill, minmax(250px, 1fr)) + gap.

Flexbox vs Grid

Flexbox 1D, Grid 2D. Often used together.

Support

All modern browsers.

Sayt.uz

Main layout uses Grid template-areas. Blog listing uses an auto-fill grid.

Related articles

🌾 Agriculture and Agribusiness Website: Product Catalog and B2B Sales ❤️ Charity Foundation Website: Transparent Fundraising and Donor Trust 🎉 Wedding Venue and Banquet Hall Website: Event Planning and Online Booking 🚙 Car Rental Website: Vehicle Catalog, Price Calculator, and Online Booking
🌐 Language
🇺🇿 O'zbek 🇺🇿 Ўзбек 🇷🇺 Русский 🇬🇧 English ✓