column-dense-packing-multi-span-012-ref.html (1663B)
1 <!DOCTYPE html> 2 <html> 3 <style> 4 .grid { 5 display: grid; 6 grid-template-columns: repeat(3, 50px); 7 grid-auto-flow: dense; 8 } 9 </style> 10 <body> 11 <p>When dense-packing, ensure that open tracks are split correctly.</p> 12 <div class="grid"> 13 <div style="background: lightskyblue; height: 30px; grid-column: 1;" > 14 1 15 </div> 16 <div style="grid-column: 1 / span 2;"> 17 <div style="background: blue; height: 15px; grid-column: 1 / span 2;"> 18 2 19 </div> 20 <div style="background: lightskyblue; height: 30px; grid-column: 1 / span 1;" > 21 3 22 </div> 23 </div> 24 <div style="grid-column: span 2;"> 25 <div style="background: yellow; height: 15px;"> 26 5 27 </div> 28 <div style="background: yellow; height: 15px;"> 29 6 30 </div> 31 </div> 32 <div style="background: lightskyblue; height: 90px; grid-column: 3;" > 33 7 34 </div> 35 <div style="grid-column: 1; transform: translateY(-45px);"> 36 <div style="background: blue; height: 15px; width: 100px;"> 37 4 38 </div> 39 <div style="background: yellow; height: 15px; width: 50px; grid-column: span 2;"> 40 9 41 </div> 42 <div style="background: yellow; height: 10px;"> 43 11 44 </div> 45 </div> 46 <div style="background: blue; height: 10px; grid-column: 2 / span 2; transform: translateY(-40px);"> 47 8 48 </div> 49 <div style="background: yellow; height: 30px; width: 100px; grid-column: 2; transform: translateY(-125px);"> 50 10 51 </div> 52 <div style="background: yellow; height: 15px; grid-column: 2; grid-row: 3; transform: translateY(-15px);"> 53 12 54 </div> 55 </div> 56 </body> 57 </html>