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/column-auto-repeat-016.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<html>
<title>Auto repeat tracks with fixed size</title>
<link rel="match" href="column-auto-repeat-016-ref.html">
<link rel="author" title="Alison Maher" href="mailto:almaher@microsoft.com">
<style>
.masonry {
    display: masonry;
    background: gray;
    item-tolerance: 0;
    grid-template-columns: repeat(auto-fit, 100px);
    height: 300px;
}
.masonry > div {
    width: 100%;
    height: 100px;
}
</style>
<body>
  <div class="masonry">
    <div style="background: lightskyblue;">
      Number 1
    </div>
    <div style="background: lightcoral;">
      Number 2
    </div>
    <div style="background: lightgreen;">
      Number 3
    </div>
    <div style="background: lightpink;">
      Number 4
    </div>
    <div style="background: orange;">
      Number 5
    </div>
    <div style="grid-column: span 2; background: brown;">
      Number 6
    </div>
    <div style="grid-column: span 3; background: blue;">
      Number 7
    </div>
    <div style="grid-column: span 3; background: yellow;">
      Number 8
    </div>
  </div>
</body>
</html>