Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Build a responsive masonry layout for images using only CSS.

Hard

Problem Statement

Build a responsive masonry layout for images using only CSS.

Sample Output

Images are displayed in a masonry-style grid.

Limits

Time: 2s · Memory: 256 MB

Code Editor

Try your code in this preview. Submit marks it done.

<!DOCTYPE html> <html> <head> <style> /* Add CSS here to create the masonry layout */ </style> </head> <body> <div class="masonry"> <img src="img1.jpg" alt="Image 1" /> <img src="img2.jpg" alt="Image 2" /> <img src="img3.jpg" alt="Image 3" /> <img src="img4.jpg" alt="Image 4" /> </div> </body> </html>

Document

To view the HTML changes, please type the code within the editor