Day 11 of Learning Web Development — I Finally Understood Flexbox (And Layout Started Making Sense)
Yesterday, I focused on basic CSS concepts.
Day 11 of Learning Web Development — I Finally Understood Flexbox (And Layout Started Making Sense)
Yesterday, I focused on basic CSS concepts.
Colors. Fonts. Spacing. Background.
It helped a lot.
But there was still one big problem.
My layout was messy.
Things didn’t align properly.
Elements were not where I wanted them to be.
And honestly…
It felt frustrating.
So today, I focused on one thing:
Flexbox.
And this changed everything.
🚀 Why I Decided to Learn Flexbox
Until now, I was placing elements randomly.
Using margins.
Trying to “push” things into position.
Sometimes it worked.
Most of the time… it didn’t.
So I needed a better way.
Something structured.
That’s where Flexbox comes in.
🧠 What is Flexbox (Simple Understanding)
Flexbox is a way to:
Control layout and alignment of elements.
Instead of guessing positions…
You define rules.
And the browser handles the layout.
📦 1. display: flex (The Starting Point)
Everything begins with this:
.container {
display: flex;
}
This turns a normal container into a flex container.
And all items inside it become “flex items”.
💡 What I Noticed
The moment I added this…
Everything changed.
Elements that were stacked vertically…
Suddenly moved into a row.
🔄 2. Flex Direction (Row vs Column)
By default:
.container {
display: flex;
flex-direction: row;
}
👉 Items go left → right
But you can change it:
.container {
flex-direction: column;
}
👉 Items go top → bottom
🧠 Why This Matters
Before this, I had no control.
Now I can decide layout direction easily.
🎯 3. Justify Content (Horizontal Alignment)
This controls alignment on the main axis.
.container {
justify-content: center;
}
Other options:
- flex-start
- flex-end
- space-between
- space-around
🧪 What I Tried
- center → everything moved to the middle
- space-between → items spread out
👉 This felt powerful.
📍 4. Align Items (Vertical Alignment)
This controls alignment on the cross axis.
.container {
align-items: center;
}
💡 What I Learned
- justify-content = main direction
- align-items = opposite direction
At first, I mixed them up a lot.
📐 5. Gap (Spacing Made Easy)
Before, I used margins everywhere.
Now I learned:
.container {
gap: 20px;
}
👉 This adds space between items.
So much easier.
⚠️ The Confusing Part
I won’t lie.
Today was confusing at the beginning.
I struggled with:
- Understanding axes (main vs cross)
- Mixing justify and align
- Forgetting properties
At one point, nothing looked right.
💡 What Helped Me Understand
Instead of reading more…
I experimented.
- Changed values
- Refreshed page
- Observed changes
Slowly…
It started to click.
🧪 My Mini Practice
I built a simple layout:
- 3 boxes in a row
- Centered them
- Added spacing
And for the first time…
It looked clean.
🎯 What I Learned Today
- Flexbox controls layout
- Alignment is easier than before
- Spacing can be simple
- Practice is key
🔥 What’s Next?
Now that I understand Flexbox basics…
Tomorrow, I want to:
Build a full page layout using Flexbox.
Header. Content. Sections.
Let’s see if I can do it.
💬 Final Thoughts
Day 11 felt like a breakthrough.
Because now…
I’m not fighting with layout anymore.
I’m controlling it.
If you’re learning too, don’t skip Flexbox.
This is where things start to feel real.
메타데이터
- post_id
- ee5583570cb4
- slug
- day-11-of-learning-web-development-i-finally-understood-flexbox-and-layout-started-making-sense-ee5583570cb4
- url
- https://medium.com/@tanvir13/day-11-of-learning-web-development-i-finally-understood-flexbox-and-layout-started-making-sense-ee5583570cb4
- canonical_url
- https://medium.com/@tanvir13/day-11-of-learning-web-development-i-finally-understood-flexbox-and-layout-started-making-sense-ee5583570cb4
- author_url
- https://medium.com/@tanvir13
- status
- ok
- fetched_at
- 2026-07-13 06:23:13