CSS Box Model & 1D Layouts with Flexbox
Understand border-box dimensions, margin collapse, flex-direction, justify-content, align-items, and flex-grow/shrink/basis rules.
The CSS Box Model & Flexbox Mechanics
### The CSS Box Model
Every element in CSS is rendered as a rectangular box comprising:
1. **Content**: Text or media.
2. **Padding**: Internal space inside the border.
3. **Border**: Outer line boundary.
4. **Margin**: External space separating adjacent elements.
Using `box-sizing: border-box` ensures padding and border widths are included INSIDE total element width.