Skip to main content
InterviewHubPRO
Section Overview
Q34

Question 34 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

68%
CSS3 & Modern Layouts (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

CSS Masonry Layout (`grid-template-rows: masonry`).

senior LevelCode ExampleComponentsSystem Design

In Simple Words: Historically, Pinterest-style masonry layouts required heavy JavaScript libraries (Masonry.js, Isotope) to compute pixel coordinates:

  • Modern CSS Grid Level 3 introduces native masonry:
    css
    .masonry-container {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      grid-template-rows: masonry; /* Tight vertical packing! */
      gap: 1rem;
    }