LEVEL 2 • LESSON 4 OF 6
0% Complete
← Back to Learning Path

📚 Lesson 4: Common Layout Patterns

Learn the most useful Grid layouts you'll use in real projects.

Real-World Grid Patterns

Instead of starting from scratch every time, you can use these proven patterns. Each pattern solves a specific layout problem you'll encounter in real projects.

1. Two-Column Layout (Sidebar + Content)

The most common layout on the web: fixed sidebar, flexible content.

.container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
}

Perfect for: Blogs, documentation, admin panels

2. Holy Grail Layout

Classic three-column layout with header and footer.

.layout {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.header, .footer {
  grid-column: 1 / -1;
}

Perfect for: Traditional websites, content management

3. Card Grid

Responsive cards that adjust automatically.

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

Perfect for: Product listings, image galleries, blog posts

4. Dashboard Layout

Multi-panel interface for admin panels.

.dashboard {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  grid-template-rows: 60px 1fr;
  gap: 16px;
}

.nav { grid-row: 1 / 3; }
.header { grid-column: 2 / 4; }

Perfect for: Admin dashboards, analytics panels

5. Magazine Layout

Asymmetric layout for editorial content.

.magazine {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.featured { grid-column: span 4; grid-row: span 2; }
.sidebar { grid-column: span 2; }

Perfect for: News sites, blogs, portfolios

💡 Pro Tip:

Start with these patterns and customize them for your needs. They're battle-tested and work in production.

Choosing the Right Pattern

🎯 Practice Time!

Try creating a two-column layout in the generator. Experiment with different sidebar widths!

Open Generator →

📝 Quick Check (3 Questions)

1. Which pattern is best for a blog with a sidebar?

2. What does grid-column: 1 / -1 do?

3. Which pattern uses repeat(auto-fit, minmax(...))?

← Back to Learning Path