row-reverse-dense-packing-002-ref.html (719B)
1 <!DOCTYPE html> 2 <html> 3 <style> 4 .grid { 5 display: grid; 6 grid-template-rows: repeat(4, 50px); 7 grid-template-columns: repeat(2, min-content); 8 gap: 10px; 9 grid-auto-flow: dense; 10 } 11 </style> 12 <body> 13 <p>Test that we always prioritize the highest position in "open" tracks even if there is a track opening available that is lower.</p> 14 <div class="grid"> 15 <div style="background: lavender; width: 60px; grid-row: 3;"> 16 1 17 </div> 18 <div style="background: lightpink; grid-row: 1 / span 3; width: 10px;"> 19 2 20 </div> 21 <!-- APC is at line 4 after placing item 2, so item 3 should go into track 4. --> 22 <div style="background: lightgreen; width: 15px; grid-row: 4;"> 23 3 24 </div> 25 </div> 26 </body> 27 </html>