clipping-012.xht (995B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: CSS clipping test</title> 5 <link rel="author" title="David Hyatt" href="mailto:hyatt@netscape.com"/> 6 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visufx.html#clipping" /> 8 <style type="text/css"> 9 .green { 10 width: 100px; 11 height: 100px; 12 background-color: green; 13 } 14 15 .red { 16 width: 100px; 17 height: 100px; 18 margin-top: 100px; 19 margin-left: 100px; 20 background-color: red; 21 } 22 23 .clip { 24 clip: rect(0px 100px 100px 0px); 25 } 26 27 .positioned { 28 position: absolute; 29 } 30 31 .overflow { 32 overflow: hidden; 33 } 34 35 </style> 36 </head> 37 <body> 38 <p>Test passes if there is <strong>a green square</strong> and <strong>no red</strong>.</p> 39 <!-- This test is checking to make sure clip is applying to all descendants. --> 40 41 <div class="clip green positioned"> 42 <div class="red"></div> 43 <div class="red overflow"></div> 44 </div> 45 </body> 46 </html>