Course contentsShow
← Web Development
Lesson 360 of 2,9826. CSS GridFree lesson

Asymmetric Grid Layouts

Design magazine-style layouts with items spanning different numbers of rows and columns.

Asymmetric Grid Layouts

You'll learn how to create visually dynamic magazine-style layouts where grid items span different numbers of rows and columns.


What Makes a Layout Asymmetric?

Unlike uniform grids where every item occupies the same amount of space, asymmetric grids feature items of varying sizes. Think of a modern magazine cover or a Pinterest-style layout: some images are large and dominant, others are small accents, and they're arranged in a visually interesting way that breaks the monotony of identical boxes.

This design pattern draws the eye and creates visual hierarchy—perfect for portfolios, blogs, and content-heavy sites.

How It Works

You've already learned how to make items span multiple tracks using grid-column and grid-row with the span keyword. Asymmetric layouts simply use these properties strategically across different items with different span values:

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 200px);
  gap: 1rem;
}

.item-1 {
  grid-column: span 2;  /* Takes 2 columns */
  grid-row: span 2;     /* Takes 2 rows - large focal point */
}

.item-2 {
  grid-column: span 2;  /* Wide but short */
}

.item-3 {
  grid-row: span 3;     /* Tall sidebar */
}
/* Other items auto-place in remaining space */

The magic happens when you mix different span sizes. One item becomes your hero element (spanning 2×2), another stretches horizontally (2×1), and a third runs vertically (1×3). The remaining items fill gaps naturally.

Design Tips

Start by sketching your layout. Identify which content deserves emphasis. Then assign larger spans to important items and smaller spans to supporting content. The grid auto-placement algorithm fills the gaps intelligently.

Key Takeaway: Asymmetric grid layouts use varying grid-column and grid-row span values to create magazine-style designs where different items occupy different amounts of space, adding visual interest and hierarchy.