column-dense-packing-multi-span-004-ref.html (918B)
1 <!DOCTYPE html> 2 <html> 3 <style> 4 .grid { 5 display: grid; 6 grid-template-columns: repeat(5, 50px); 7 grid-auto-flow: dense; 8 } 9 </style> 10 <body> 11 <p>Ensure that dense-packing with multi-span items follows the grid-lanes dense packing algorithm.</p> 12 <div class="grid"> 13 <div style="background: brown; height: 80px;"></div> 14 <div style="background: brown; height: 60px;"></div> 15 <div style="background: brown; height: 40px;"></div> 16 <div style="background: brown; height: 30px;"></div> 17 <div style="background: brown; height: 20px;"></div> 18 <div style="background: brown; height: 20px; grid-column: span 5;"></div> 19 <div style="background: pink; height: 30px; grid-column: span 4;">Item that should not end up in gap.</div> 20 <div style="background: yellow; height: 20px; grid-column: span 4; transform: translate(50px, -70px);">Item that should end up in gap.</div> 21 </div> 22 </body> 23 </html>