single-line-row-flex-fragmentation-042-print.html (1592B)
1 <!DOCTYPE html> 2 <html> 3 <meta charset="utf-8"> 4 <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com"> 5 <link rel="author" title="Mozilla" href="https://www.mozilla.org/"> 6 <link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination"> 7 <link rel="match" href="single-line-row-flex-fragmentation-042-print-ref.html"> 8 9 <style> 10 @page { size: 5in 3in; margin: 0.5in; } 11 12 :root { 13 print-color-adjust: exact; 14 } 15 16 body { margin: 0; } 17 18 .flexbox { 19 display: flex; 20 border: 0.25in solid black; 21 font-size: 0.25in; 22 } 23 .item { 24 contain: size; 25 box-sizing: border-box; 26 border: 4px solid purple; 27 width: 25%; 28 height: 0.5in; 29 } 30 </style> 31 32 <!-- This div makes the flexbox not at the top of first page. --> 33 <div style="height: 0.25in; background: gray;"></div> 34 35 <div class="flexbox"> 36 <div class="item" style="margin-top: 1in;">1</div> 37 <div class="item">2</div> 38 39 <!-- Due to fragmentation, item 3 is being pushed down and placed at the top 40 of page 2, enlarging the flex container's block-size. Observe item 3 41 and item 4's block-end edges. Before fragmentation, both are at the 42 same level; after fragmentation, item 3's block-end edge becomes lower 43 than item 4's, and making item 4's block-end edge no longer touch the 44 flex container's content-box block-end edge.--> 45 <div class="item" style="margin-top: 1in; height: 1in;">3</div> 46 <div class="item" style="align-self: flex-end;">4</div> 47 </div> 48 49 <div style="height: 0.25in; background: gray;"></div> 50 </html>