single-line-row-flex-fragmentation-042-print-ref.html (1051B)
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 7 <style> 8 @page { size: 5in 3in; margin: 0.5in; } 9 10 :root { 11 print-color-adjust: exact; 12 } 13 14 body { margin: 0; } 15 16 .flexbox { 17 border: 0.25in solid black; 18 font-size: 0.25in; 19 height: 2.5in; 20 } 21 .item { 22 position: relative; 23 contain: size; 24 box-sizing: border-box; 25 border: 4px solid purple; 26 width: 25%; 27 height: 0.5in; 28 } 29 .gap { 30 height: 0.5in; 31 } 32 </style> 33 34 <!-- This div makes the flexbox not at the top of first page. --> 35 <div style="height: 0.25in; background: gray;"></div> 36 37 <div class="flexbox"> 38 <div class="item" style="left: 25%;">2</div> 39 <div class="gap"></div> 40 <div class="item">1</div> 41 <div class="item" style="left: 50%; height: 1in;">3</div> 42 <div class="item" style="left: 75%; top: -1in;">4</div> 43 </div> 44 45 <div style="height: 0.25in; background: gray;"></div> 46 </html>