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-columns: 30px 40px 50px 30px;
padding: 10px;
grid-auto-flow: dense;
}
</style>
<body>
<p>Ensure dense-packing only places items into gaps where the track size is the same as where the item would have been laid out WITHOUT dense packing.</p>
<div class="grid">
<div style="background: lightskyblue; height: 40px; grid-column: 1" >
1
</div>
<div style="background: lightgreen; height: 40px; grid-column: 3">
2
</div>
<div style="background: brown; height: 10px; grid-column: span 4;">
3
</div>
<div style="background: red; height: 40px; width: 30px; grid-column: 4;">
4
</div>
</div>
</body>
</html>