Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

  • This WPT test may be referenced by the following Test IDs:
<!DOCTYPE html>
<html>
<title>Auto-fit repeat tracks with auto size</title>
<link rel="help" href="https://drafts.csswg.org/css-grid-3">
<link rel="match" href="column-auto-repeat-auto-012-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, auto);
height: 300px;
width: 300px;
}
.masonry > div {
width: 100px;
height: 100px;
}
</style>
<body>
<div class="masonry">
<!-- The second track should still be collapsed, even though this
item is placed in every possible track. -->
<div style="background: lightskyblue;">
Number 1
</div>
<div style="background: lightcoral; grid-column: 3;">
Number 2
</div>
<div style="background: lightgreen; grid-column: 1;">
Number 3
</div>
<div style="background: lightpink; grid-column: 3;">
Number 4
</div>
<div style="background: orange; grid-column:1;">
Number 5
</div>
</div>
</body>
</html>