clipping-009.xht (918B)
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 <link rel="help" href="http://www.w3.org/TR/CSS21/visufx.html#clipping" /> 5 <link rel="author" title="David Hyatt" href="mailto:hyatt@netscape.com"/> 6 <style type="text/css"> 7 .green { 8 width: 100px; 9 height: 100px; 10 background-color: green; 11 } 12 13 .red { 14 width: 100px; 15 height: 100px; 16 margin-top: 100px; 17 margin-left: 100px; 18 background-color: red; 19 } 20 21 .clip { 22 clip: rect(0px 100px 100px 0px); 23 } 24 25 .positioned { 26 position: absolute; 27 } 28 </style> 29 </head> 30 <body> 31 <p>Test passes if there is <strong>a green square</strong> and <strong>no red</strong>.</p> 32 33 <!-- This test is checking to make sure clip is applying to all descendants. --> 34 35 <div class="clip green positioned"> 36 <div class="red"></div> 37 <div class="red positioned"></div> 38 </div> 39 </body> 40 </html>