Website layout combines spacing, typography, and responsive grid/flex decisions into a coherent page structure.
Layout foundation
- Page wrapper with sensible max width.
- Consistent spacing scale for sections.
- Mobile-first breakpoints based on content needs.
- Reusable layout primitives (stack, cluster, sidebar/grid).
Rendered output
Important interview questions and answers
- Q: Flex vs Grid for page layout?
A: Grid suits two-dimensional page regions; flex suits one-dimensional component alignment. - Q: Why start layout mobile-first?
A: Forces essential hierarchy and scales up progressively. - Q: What is your pre-ship CSS layout check?
A: Validate at key widths, zoom levels, and keyboard navigation paths.
Pitfall: Check cascade order—author stylesheet loses to inline styles and !important surprises.