row-dense-packing-001-ref.html (1512B)
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 width: 170px; 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 places items correctly in grid-lanes.</p> 21 <div class="grid"> 22 <div class="flex"> 23 <div style="background: lightskyblue; width: 20px;" > 24 1 25 </div> 26 <div style="background: red; width: 40px;"> 27 5 28 </div> 29 <div style="background: brown; width: 10px; height: 100px;"> 30 4 31 </div> 32 <div style="background: yellow; width: 40px;"> 33 7 34 </div> 35 </div> 36 <div class="flex"> 37 <div style="background: lightcoral; width: 60px;" > 38 2 39 </div> 40 <div style="background: brown; width: 10px;"></div> 41 <div style="background: blueviolet; width: 12px; grid-row: 2; margin-left: 3px;"> 42 9 43 </div> 44 <div style="background: orange; width: 20px; grid-row: 2;"> 45 10 46 </div> 47 <div style="background: brown; width: 10px; grid-row: span 2;"> 48 8 49 </div> 50 </div> 51 <div class="flex"> 52 <div style="background: lightgreen; width: 60px;"> 53 3 54 </div> 55 <div style="background: pink; width: 45px;"> 56 6 57 </div> 58 <div style="background: brown; width: 10px;"></div> 59 </div> 60 </div> 61 </body> 62 </html>