page-background-005-print.html (1746B)
1 <!DOCTYPE html> 2 <link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> 3 <link rel="help" href="https://drafts.csswg.org/css-page-3/#painting"> 4 <meta name="assert" content="The root element has a different background painting area and thus the background-clip property has no effect when specified on it."> 5 <link rel="match" href="page-background-005-print-ref.html"> 6 <style> 7 @page { 8 size: 600px 300px; 9 margin: 20px; 10 border: 20px solid blue; 11 padding: 20px; 12 background-image: url(support/cat.png); 13 background-repeat: no-repeat; 14 } 15 @page border { 16 background-origin: border-box; 17 } 18 @page padding { 19 background-origin: padding-box; 20 } 21 @page content { 22 background-origin: content-box; 23 } 24 :root { 25 print-color-adjust: exact; 26 } 27 body { 28 margin: 0; 29 } 30 .text { 31 /* Add some padding to leave some room for glyph overflow. 32 The page area may clip overflow, although the ref doesn't. */ 33 padding: 0 5px; 34 background: #ddd; 35 } 36 </style> 37 <div style="page:border; padding-top:100px;"> 38 <div class="text"> 39 There should be a cat in the top left corner, flush with the border 40 edge. The blue border should be painted on top of the cat. 41 </div> 42 </div> 43 <div style="page:padding; padding-top:100px;"> 44 <div class="text"> 45 There should be a cat in the top left corner, flush with the padding box, 46 i.e. just inside the blue border. 47 </div> 48 </div> 49 <div style="page:content;"> 50 <div style="margin-left:105px; width:10px; height:100px; background:orange;"></div> 51 <div class="text"> 52 There should be a cat in the top left corner, flush with the content box 53 (left-aligned with this box, vertically aligned with the orange bar). 54 </div> 55 </div>