contain-paint-clip-001.html (1414B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Test: 'contain: paint' with various overflowing block descendants.</title> 6 <link rel="author" title="Kyle Zentner" href="mailto:zentner.kyle@gmail.com"> 7 <link rel="help" href="https://drafts.csswg.org/css-contain/#containment-paint"> 8 <link rel="match" href="contain-paint-clip-001-ref.html"> 9 <style> 10 .root { 11 contain: paint; 12 width: 100px; 13 height: 100px; 14 background: blue; 15 margin: 25px; 16 padding: 25px; 17 } 18 .a { 19 width: 100px; 20 height: 200px; 21 background: red; 22 } 23 .b { 24 width: 150px; 25 height: 150px; 26 background: green; 27 position: relative; 28 top: -25px; 29 left: -25px; 30 } 31 .background { 32 position: absolute; 33 top: 0; 34 left: 0; 35 width: 200px; 36 height: 200px; 37 background: red; 38 z-index: -1; 39 } 40 .foreground { 41 position: absolute; 42 top: -25px; 43 left: -25px; 44 width: 150px; 45 height: 150px; 46 border: 25px solid red; 47 z-index: 1; 48 } 49 </style> 50 </head> 51 <body> 52 <div class="root"> 53 <div class="a"> 54 <div class="b"></div> 55 <!--These two absolutely positioned elements are checking that all sides are--> 56 <!--clipped. They also test that clipping is done correctly on absolutely--> 57 <!--positioned elements.--> 58 <div class="background"></div> 59 <div class="foreground"></div> 60 </div> 61 </div> 62 </body> 63 </html>