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-intrinsic-sizing-oof.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Masonry Test: Masonry layout intrinsic size with only OOF children</title>
<link rel="author" title="Yanling Wang" href="mailto:yanlingwang@microsoft.com">
<link rel="match" href="column-masonry-intrinsic-sizing-oof-ref.html">
<style>
.container {
border: 2px solid black;
margin: 10px;
width: 300px;
position: relative;
}
.masonry {
display: masonry;
grid-template-columns: repeat(3, auto);
border: 2px solid blue;
}
.oof-item {
position: absolute;
background: red;
color: white;
padding: 5px;
border: 1px solid darkred;
}
.oof-1 {
top: 50px;
left: 50px;
width: 60px;
height: 40px;
}
.oof-2 {
top: 100px;
left: 150px;
width: 70px;
height: 50px;
}
</style>
</head>
<body>
<div class="container">
<div class="masonry">
<div class="oof-item oof-1"></div>
<div class="oof-item oof-2"></div>
</div>
</div>
</body>
</html>