grid-fragmentation-003.html (3463B)
1 <!DOCTYPE HTML> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <html><head> 7 <meta charset="utf-8"> 8 <title>CSS Grid Test: Fragmentation height:auto grid with first grid row at top-of-page</title> 9 <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1144096"> 10 <link rel="help" href="https://drafts.csswg.org/css-grid/#pagination"> 11 <link rel="match" href="grid-fragmentation-003-ref.html"> 12 <style type="text/css"> 13 html,body { 14 color:black; background-color:white; font-size:16px; padding:0; margin:0; 15 } 16 body { overflow:hidden; } 17 18 .columns { 19 position:relative; 20 -ms-columns: 5; 21 -webkit-columns: 5; 22 columns: 5; 23 -ms-column-fill: auto; 24 -webkit-column-fill: auto; 25 column-fill: auto; 26 border: 2px solid salmon; 27 margin-bottom: 5px; 28 } 29 30 .grid { 31 display: grid; 32 grid-template-columns: 30px 30px 30px; 33 grid-auto-rows: 50px; 34 grid-gap: 12px; 35 border:5px solid; 36 border-top-width:0; 37 border-bottom-width:10px; 38 } 39 span { background:lime; border:1px solid black; } 40 x { display:block; height:20px; } 41 42 </style> 43 </head> 44 <body> 45 46 <div class="columns" style="height: 120px/*fragmentainer ends in the end border*/"> 47 <div style="background:grey"> 48 <div class="grid"> 49 <span style="grid-row:span 2"><x></x></span> 50 <span style="height:60px; background:cyan"><x></x></span> 51 <span><x></x></span> 52 <span style="align-self:end; background:pink"><x></x></span> 53 <span style="grid-row:1"><x></x></span> 54 </div></div></div> 55 56 <div class="columns" style="height: 8px/*fragmentainer ends in the end border*/"> 57 <div style="background:grey"> 58 <div class="grid"> 59 </div></div></div> 60 61 <div class="columns" style="height: 10px/*fragmentainer ends in the end border*/"> 62 <div style="background:grey"> 63 <div class="grid" style="height:2px/*creates a Class C break opportunity at the end*/"> 64 </div></div></div> 65 66 <div class="columns" style="height: 90px/*fragmentainer ends in the last row*/"> 67 <div style="background:grey"> 68 <div class="grid"> 69 <span style="grid-row:span 2"><x></x></span> 70 <span style="height:60px; background:cyan"><x></x></span> 71 <span style="align-self:end; background:pink"><x></x></span> 72 <span style="grid-row:1; height:60px"><x></x></span> 73 </div></div></div> 74 75 <div class="columns" style="height: 60px/*fragmentainer ends in the grid gap between the rows */"> 76 <div style="background:grey"> 77 <div class="grid"> 78 <span style="grid-row:span 2"><x></x></span> 79 <span style="height:60px; background:cyan"><x></x></span> 80 <span style="align-self:end; background:pink"><x></x></span> 81 <span style="grid-row:1; height:60px"><x></x></span> 82 </div></div></div> 83 84 <div class="columns" style="height: 30px/*fragmentainer ends in the first row*/; margin-bottom:30px"> 85 <div style="background:grey"> 86 <div class="grid"> 87 <span style="grid-row:span 2"><x></x></span> 88 <span style="height:60px; background:cyan"><x></x></span> 89 <span style="align-self:end; background:pink"><x></x></span> 90 <span style="grid-row:1; height:60px"><x></x></span> 91 </div></div></div> 92 93 <div class="columns" style="height: 0px/*zero height fragmentainer*/; margin-bottom:60px"> 94 <div style="background:grey"> 95 <div class="grid"> 96 <span style="grid-row:span 2"><x></x></span> 97 <span style="height:60px; background:cyan"><x></x></span> 98 <span style="align-self:end; background:pink"><x></x></span> 99 <span style="grid-row:1; height:60px"><x></x></span> 100 </div></div></div> 101 102 </body> 103 </html>