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/track-sizing/auto-repeat/intrinsic-auto-repeat/row-auto-repeat-auto-017.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<html>
<title>Auto-fit repeat tracks with auto size and explicit spanning item placement</title>
<link rel="match" href="row-auto-repeat-auto-017-ref.html">
<link rel="author" title="Alison Maher" href="mailto:almaher@microsoft.com">
<style>
.masonry {
    display: masonry;
    item-tolerance: 0;
    masonry-direction: row;
    grid-template-rows: repeat(auto-fit, auto);
    width: 200px;
    height: 500px;
    gap: 10px;
}
.masonry > div {
    height: 50px;
    width: 100px;
    background-color: orange;
}
</style>
<div class="masonry">
  <div style="grid-row: span 4; height: 200px;">1</div>
  <div style="grid-row: 4 / span 2; height: 100px;">2</div>
  <div style="grid-row: 9 / span 2; height: 100px;">3</div>
  <div style="grid-row: 7;">4</div>
  <div style="grid-row: span 2; height: 100px;">5</div>
  <div>6</div>
</div>
</html>