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/column-auto-repeat-max-content-004.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<title>Auto repeat tracks with max-content track size</title>
<link rel="help" href="https://drafts.csswg.org/css-grid-3">
<link rel="match" href="column-auto-repeat-max-content-001-ref.html">
<link rel="author" title="Alison Maher" href="mailto:almaher@microsoft.com">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
.masonry {
display: masonry;
background: gray;
item-tolerance: 0;
grid-template-columns: repeat(auto-fill, max-content max-content);
width: 300px;
height: 300px;
font: 15px/1 Ahem;
}
.masonry > div {
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>
</body>
</html>