Complete the lesson quiz and earn 250 XP.
A grid is an underlying structure of intersecting horizontal and vertical guidelines used to organize content with mathematical discipline:
Why has the 12-column grid remained the undisputed industry standard for web and desktop interfaces for over two decades?
The number 12 is divisible by 1, 2, 3, 4, 6, and 12:
A 10-column or 8-column grid lacks the versatility to accommodate thirds and quarters simultaneously.
Grids behave differently as viewports expand:
fr units or %).While column grids govern horizontal layout, baseline grids govern vertical alignment:
A baseline grid consists of horizontal lines repeating at fixed increments (standardly 4px or 8px):
Modern web layouts combine two powerful CSS layout engines:
Historically, responsive design depended on Media Queries, which evaluate the global browser viewport width. This created a major flaw in modular design systems:
A card component placed in a wide sidebar had to render in a cramped space despite the browser viewport being 1440px wide.
@container)Container queries allow a component to inspect the width of its immediate parent container rather than the screen:
@container (max-width: 400px) {
.product-card {
flex-direction: column;
}
}
This makes components genuinely modular: a card adapts its grid layout automatically regardless of whether it lives in a narrow sidebar or a wide main feed.