row-reverse-dense-packing-multi-span-001-ref.html (1235B)
1 <!DOCTYPE html> 2 <html> 3 <style> 4 .grid { 5 display: grid; 6 grid-auto-flow: dense; 7 grid-template-rows: repeat(4, 50px); 8 grid-template-columns: repeat(3, min-content); 9 } 10 </style> 11 <body> 12 <p>Ensure that dense-packing places multi-spanning item into highest eligible track opening. The yellow item should be placed in track opening.</p> 13 <div class="grid"> 14 <div style="background: lightskyblue; width: 70px; grid-row: 4;" > 15 1 16 </div> 17 <div style="background: lightblue; width: 15px; grid-row: 1;" > 18 2 19 </div> 20 <div style="background: yellow; width: 10px; grid-row: 2 / span 2;" > 21 4 22 </div> 23 <div style="background: darkblue; width: 20px; grid-row: 1 / span 2; transform: translateX(-55px);"> 24 3 25 </div> 26 <div style="background: lightblue; width: 70px; grid-row: 3; transform: translateX(-60px);" > 27 5 28 </div> 29 <div style="background: darkblue; width: 10px; grid-row: 2 / span 3; grid-column: 3; transform: translateX(-60px);"> 30 6 31 </div> 32 <div style="background: yellow; width: 10px; grid-row: 1 / span 2; grid-column: 3; transform: translateX(-105px);" > 33 7 34 </div> 35 <div style="background: yellow; width: 10px; grid-row: 2; transform: translateX(-105px);" > 36 8 37 </div> 38 </div> 39 </body> 40 </html>