body-background-vlr-print-ref.html (631B)
1 <!DOCTYPE html> 2 <style> 3 :root { 4 print-color-adjust: exact; 5 } 6 body { 7 margin: 0; 8 } 9 @page { 10 size: 800px 600px; 11 margin: 0; 12 } 13 </style> 14 <p style="position:absolute; right:20px; top:0; width:160px;"> 15 There should be a top-left-aligned blue box on the first page, and a 16 top-aligned hotpink box on the second page. 17 The background of the first page is lightgray, and the background of the 18 second page is white. 19 </p> 20 <div style="height:600px; background:lightgray"> 21 <div style="width:600px; height:100px; background:blue;"></div> 22 </div> 23 <div style="width:800px; height:100px; background:hotpink;"></div>