Grid intro covers container, tracks, gaps, and placement basics.
Starter recipe
- Define columns with
grid-template-columns. - Define rows as needed with
grid-template-rows. - Use
gapfor spacing.
Important interview questions and answers
- Q: What is an implicit track?
A: Auto-created track when items exceed explicit template definitions. - Q: Why minmax in grid?
A: Sets flexible lower/upper bounds for robust responsive sizing. - Q: Can grid and flex be combined?
A: Yes, common pattern: grid for page sections, flex inside components.
Tip: Use fr units and gap instead of margin hacks between tracks.