clipping-015

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#overflow">
 7 <style type="text/css">
 8 div {
 9   width: 100px;
10   height: 100px;
11 }
12 
13 .green {
14   background-color: green;
15 }
16 
17 .red {
18   background-color: red;
19 }
20 
21 .absolute {
22   position: absolute;
23   top:100px;
24   left:100px;
25 }
26 
27 .relative {
28   position: relative;
29   top:100px;
30   left:100px;
31 }
32 
33 .overflow {
34   overflow: hidden;
35 }
36 </style>
37 </head>
38 <body>
39 <p>Test passes if there is <strong>a green square</strong> and <strong>no red</strong>.</p>
40 
41 <!-- This test makes sure overflow uses containing blocks when clipping. -->
42 
43 <div class="green overflow">
44   <div class="red relative">
45     <div class="absolute red"></div>
46   </div>
47 </div>
48 </body>
49 </html>