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-row-002.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<html><head>
<meta charset="utf-8">
<title>CSS Grid Test: Masonry layout with item-tolerance: normal (row direction)</title>
<link rel="author" title="Apple Inc.">
<link rel="match" href="item-tolerance-row-002-ref.html">
<style>
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
grid {
display: inline-grid-lanes;
masonry-direction: row;
grid-auto-flow: column;
gap: 10px;
grid-template-rows: repeat(3, 100px);
item-tolerance: normal; /* Should resolve to 1em (16px) */
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="width: 70px">1</item>
<item style="width: 50px">2</item>
<item style="width: 30px">3</item>
<item style="width: 70px">4</item>
<item style="width: 50px">5</item>
<item style="width: 30px">6</item>
</grid>
</body>
</html>