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/grid-lanes/tentative/item-placement/item-tolerance/item-tolerance-column-003.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<html><head>
<meta charset="utf-8">
<title>CSS Grid Test: Masonry layout with item-tolerance: 51px</title>
<link rel="author" title="Apple Inc.">
<link rel="match" href="item-tolerance-column-003-ref.html">
<style>
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
grid {
display: inline-grid-lanes;
gap: 10px;
grid-template-columns: repeat(3, 100px);
item-tolerance: 51px; /* Tracks within 51px are considered equal */
color: #444;
border: 1px solid;
padding: 2px;
}
item {
background-color: #444;
color: #fff;
padding: 10px;
margin: 3px;
border: 2px solid blue;
}
</style>
</head>
<body>
<grid>
<item style="height: 150px">1</item>
<item style="height: 100px">2</item>
<item style="height: 90px">3</item>
<item style="height: 100px">4</item>
<item style="height: 110px">5</item>
<item style="height: 50px">6</item>
</grid>
</body>
</html>