grid-fragmentation-003-ref.html (4570B)
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>Reference: 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 <style type="text/css"> 11 html,body { 12 color:black; background-color:white; font-size:16px; padding:0; margin:0; 13 } 14 body { overflow:hidden; } 15 16 .columns { 17 position:relative; 18 -ms-columns: 5; 19 -webkit-columns: 5; 20 columns: 5; 21 -ms-column-fill: auto; 22 -webkit-column-fill: auto; 23 column-fill: auto; 24 border: 2px solid salmon; 25 margin-bottom: 5px; 26 } 27 28 .block { 29 border:5px solid; 30 border-top-width:0; 31 border-bottom-width:10px; 32 } 33 .grid { 34 display: grid; 35 grid-template-columns: 30px 30px 30px; 36 grid-auto-rows: 50px; 37 grid-gap: 12px; 38 border:5px solid; 39 border-top-width:0; 40 border-bottom-width:10px; 41 } 42 span { background:lime; border:1px solid black; } 43 x { display:block; height:20px; } 44 45 .t { border-bottom-width:0; } 46 .b { border-top-width:0; } 47 br { page-break-before:always; break-before:always; } 48 49 </style> 50 </head> 51 <body> 52 53 <div class="columns" style="height: 120px/*fragmentainer ends in the end border*/"> 54 <div style="background:grey"> 55 <div class="grid t"> 56 <span><x></x></span> 57 <span class="t"><x></x></span> 58 <span style="background:cyan" class="t"><x></x></span> 59 </div> 60 <br> 61 <div class="grid b"> 62 <span><x></x></span> 63 <span class="b"><x></x></span> 64 <span class="b" style="grid-row:1; grid-column:3; height:11px; background:cyan"><x></x></span> 65 <span style="grid-row:1; grid-column:3; align-self:end; background:pink"><x></x></span> 66 </div></div></div> 67 68 <div class="columns" style="height: 8px/*fragmentainer ends in the end border*/"> 69 <div style="background:grey"> 70 <div class="block"> 71 </div></div></div> 72 73 <div class="columns" style="height: 10px/*fragmentainer ends in the end border*/"> 74 <div style="background:grey"> 75 <div class="block" style="height:2px/*creates a Class C break opportunity at the end*/"> 76 </div></div></div> 77 78 <div class="columns" style="height: 90px/*fragmentainer ends in the last row*/"> 79 <div style="background:grey"> 80 <div class="grid t"> 81 <span class="t"><x></x></span> 82 <span class="t"><x></x></span> 83 <span style="background:cyan" class="t"><x></x></span> 84 </div> 85 <br> 86 <div class="grid b"> 87 <span class="b"><x></x></span> 88 <span class="b" style="grid-row:1; grid-column:1; height:11px;"><x></x></span> 89 <span class="b" style="grid-row:1; grid-column:3; height:11px; background:cyan"><x></x></span> 90 <span style="grid-row:1; grid-column:1; align-self:end; background:pink"><x></x></span> 91 </div></div></div> 92 93 <div class="columns" style="height: 60px/*fragmentainer ends in the grid gap between the rows */"> 94 <div style="background:grey"> 95 <div class="grid t"> 96 <span class="t"><x></x></span> 97 <span class="t"><x></x></span> 98 <span style="background:cyan" class="t"><x></x></span> 99 </div> 100 <div class="grid b"> 101 <span class="b"><x></x></span> 102 <span class="b" style="grid-row:1; grid-column:1; height:11px;"><x></x></span> 103 <span class="b" style="grid-row:1; grid-column:3; height:11px; background:cyan"><x></x></span> 104 <span style="grid-row:1; grid-column:1; align-self:end; background:pink"><x></x></span> 105 </div></div></div> 106 107 <div class="columns" style="height: 30px/*fragmentainer ends in the first row*/; margin-bottom:30px"> 108 <div style="background:grey"> 109 <div class="grid t"> 110 <span class="t"><x></x></span> 111 <span class="t"><x></x></span> 112 <span style="background:cyan" class="t"><x></x></span> 113 </div> 114 <div class="grid b"> 115 <span class="b"><x></x></span> 116 <span class="b" style="grid-row:1; grid-column:1; height:11px;"><x></x></span> 117 <span class="b" style="grid-row:1; grid-column:3; height:11px; background:cyan"><x></x></span> 118 <span style="grid-row:1; grid-column:1; align-self:end; background:pink"><x></x></span> 119 </div></div></div> 120 121 <div class="columns" style="height: 0px/*zero height fragmentainer*/; margin-bottom:60px"> 122 <div style="background:grey"> 123 <div class="grid t"> 124 <span class="t"><x></x></span> 125 <span class="t"><x></x></span> 126 <span style="background:cyan" class="t"><x></x></span> 127 </div> 128 <div class="grid b"> 129 <span class="b"><x></x></span> 130 <span class="b" style="grid-row:1; grid-column:1; height:11px;"><x></x></span> 131 <span class="b" style="grid-row:1; grid-column:3; height:11px; background:cyan"><x></x></span> 132 <span style="grid-row:1; grid-column:1; align-self:end; background:pink"><x></x></span> 133 </div></div></div> 134 135 </body> 136 </html>