Day 11 – Exploring the Power of CSS Grid


Hey everyone! 👋
Today at Cudose Creative Agency, we dove into the world of CSS Grid, and it was nothing short of exciting. With Flexbox fresh in our minds, CSS Grid felt like the missing puzzle piece for 2-dimensional layouts.
---What is CSS Grid?
CSS Grid is a powerful layout system that allows us to create complex, responsive grid-based designs with ease. Unlike Flexbox (which is 1-dimensional), Grid works in both rows and columns.
To get started, you simply declare:
display: grid;
you unlock layout magic.
What We Learned Today:
1. Creating a Grid Container
.container {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: auto;
gap: 1rem;
}
1fr means one fraction of available space
repeat(3, 1fr) creates 3 equal-width columns
---2. Placing Grid Items
We learned how to position items precisely:
.item {
grid-column: 1 / 3;
grid-row: 2 / 4;
}
---3. Grid Gap (Spacing)
gap: 20px;
Simplifies spacing between rows and columns — no more hacking with margins.
---4. Auto-Fit & Auto-Fill
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
This combo makes your grid responsive and adaptable for all screen sizes — perfect for real-world design systems.
---5. Grid Area Naming
grid-template-areas:
"header header"
"sidebar main"
"footer footer";
This made layout planning feel like sketching — very intuitive!
---Why CSS Grid Matters
Perfect for 2D layout problems
Great for full-page structures
Complements Flexbox in modern frontend design
Encourages clean, maintainable CSS
---Final Thoughts
Flexbox gave us flexibility. Grid gave us structure.
After today, I feel like I can approach layout design with real confidence — whether it’s a dashboard, landing page, or complex portfolio. Grid makes it make sense. A cheat game I used is Grid grade, saved best for life check it out to learn grid better.
Subscribe to my newsletter
Read articles from Oyiguh Jordan Anibe directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
