row-dense-packing-002-ref.html (1127B)
1 <!DOCTYPE html> 2 <html> 3 <link rel="help" href="https://drafts.csswg.org/css-grid-3"> 4 <style> 5 .grid { 6 display: grid; 7 background: gray; 8 position: relative; 9 grid-template-rows: repeat(3, 50px); 10 padding: 10px; 11 grid-auto-flow: dense; 12 } 13 14 .flex { 15 display: flex; 16 flex-direction: row; 17 } 18 </style> 19 <body> 20 <p>Ensure that dense-packing always prioritizes the start-most track opening. Item 6 should go into the top-most track-opening.</p> 21 <div class="grid"> 22 <div class="flex"> 23 <div style="background: lightskyblue; width: 20px;" > 24 1 25 </div> 26 <div style="background: yellow; width: 40px;"> 27 6 28 </div> 29 </div> 30 <div class="flex"> 31 <div style="background: lightcoral; width: 60px;" > 32 2 33 </div> 34 <div style="background: brown; width: 10px; height: 150px; transform: translateY(-50px);"> 35 4 36 </div> 37 <div style="background:orchid; width: 10px; height: 100px; transform: translateY(-50px);"> 38 5 39 </div> 40 </div> 41 <div style="background: lightgreen; width: 20px;"> 42 3 43 </div> 44 </div> 45 </body> 46 </html>