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/abspos/column-masonry-out-of-flow-002.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Masonry Test: Masonry layout out-of-flow positioning</title>
<link rel="author" title="Yanling Wang" href="mailto:yanlingwang@microsoft.com">
<link rel="match" href="column-masonry-out-of-flow-002-ref.html">
<style>
.container {
width: 300px;
height: 150px;
border: 2px solid black;
margin: 20px;
}
.masonry {
display: masonry;
grid-template-columns: repeat(4, 60px);
border: 1px solid blue;
padding: 10px;
gap: 5px;
position: relative;
}
.item {
background: lightblue;
padding: 5px;
height: 100px;
}
.wrapper {
background: lightgreen;
padding: 5px;
height: 60px;
border: 1px dashed green;
}
.absolute {
position: absolute;
background: red;
grid-column: 1 / 2;
top: 30px;
width: 20px;
height: 20px;
}
.static-pos-with-grid-column {
position: absolute;
background: yellow;
grid-column: 2 / 3;
width: 10px;
height: 10px;
}
.static-pos {
position: absolute;
background: orange;
width: 10px;
height: 10px;
}
</style>
</head>
<body>
<div class="container">
<div class="masonry">
<div class="item">
<div class="wrapper">
<div class="absolute"></div>
</div>
</div>
<div class="item">
<div class="wrapper">
<div class="static-pos-with-grid-column"></div>
</div>
</div>
<div class="item">
<div class="static-pos"></div>
</div>
<div class="item"></div>
</div>
</div>
</body>
</html>