Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<html>
<link rel="help" href="https://drafts.csswg.org/css-grid-3">
<style>
.grid {
display: grid;
background: gray;
position: relative;
grid-template-rows: repeat(3, 50px);
padding: 10px;
grid-auto-flow: dense;
}
.flex {
display: flex;
flex-direction: row;
}
</style>
<body>
<p>Ensure that dense-packing places items correctly based on the auto-placement cursor location when there are multiple gaps. Item 5 should go into the bottom-most gap.</p>
<div class="grid">
<div class="flex">
<div style="background: lightskyblue; width: 20px;" >
1
</div>
<div style="background: red; width: 40px;">
6
</div>
</div>
<div class="flex">
<div style="background: lightcoral; width: 60px;" >
2
</div>
<div style="background: brown; width: 10px; height: 150px; transform: translateY(-50px);">
4
</div>
<div style="background:orchid; width: 10px; height: 100px; transform: translateY(-50px);">
5
</div>
</div>
<div style="background: lightgreen; width: 20px;">
3
</div>
</div>
</body>
</html>