clipping-011

CSS clipping test

WeasyPrint

This browser

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3 <head>
 4 <title>CSS Test: CSS clipping test</title>
 5 <link rel="author" title="David Hyatt" href="mailto:hyatt@netscape.com">
 6 <link rel="help" href="http://www.w3.org/TR/CSS21/visufx.html#clipping">
 7 <style type="text/css">
 8 .green {
 9   width: 100px;
10   height: 100px;
11   background-color: green;
12 }
13 
14 .red {
15   width: 100px;
16   height: 100px;
17   margin-top: 100px;
18   margin-left: 100px;
19   background-color: red;
20 }
21 
22 .clip {
23   clip: rect(0px 100px 100px 0px);
24 }
25 
26 .positioned {
27   position: fixed;
28 }
29 
30 .overflow {
31   overflow: hidden;
32 }
33 
34 </style>
35 </head>
36 <body>
37 <p>Test passes if there is <strong>a green square</strong> and <strong>no red</strong>.</p>
38 
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>