Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

CSS Grid – Fundamentals | CSS Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. CSS Course

Lesson 27 of 50

·css

CSS Grid – Fundamentals

15 mins

Course progress54%

What you'll learn

Keep these ideas in mind as you work through the lesson.

3 points
  • Implicit grid tracks are created automatically for items placed outside the defined grid.
  • `fr` unit distributes free space proportionally.
  • Combine Grid with Flexbox inside grid items for complex UI.

CSS Grid provides a two‑dimensional layout system.

  • Define a grid container: display:grid;.
  • Set columns/rows: grid-template-columns: repeat(12, 1fr);.
  • Place items with grid-column, grid-row or shortcut grid-area.
  • Gap – grid-gap / column-gap / row-gap.

Example: Simple 12‑col layout

.container {
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:1rem;
}
.sidebar { grid-column:1 / span 3; }
.main { grid-column:4 / span 9; }
Make it stickPractice what you've learned1 quiz · 6 practical tests · Optional activities from CSS CourseBrowse activities
Previous lessonLogical Properties & Writing ModesContinue to lesson 28Advanced Grid – Named Areas & Sub‑GridsBack to CSS Course curriculum