Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            
- /css/css-grid/masonry/tentative/item-placement/masonry-item-placement-008.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  <title>CSS Grid Test: Masonry item placement w/ Images</title>
  <link rel="author" title="Brandon Stewart" href="mailto:brandonstewart@apple.com">
  <link rel="match" href="masonry-item-placement-008-ref.html">
</head>
<body>
<style>
grid {
  display: inline-masonry;
  grid-template-columns: repeat( auto-fill, minmax(200px, 400px) );
  gap: 30px;
  max-width: 50vw;
}
img {
  width: 100%;
  height: auto;
  background-color: cyan;
}
</style>
<grid>
    <img width="400" height="400" />
</grid>
</body>
</html>