background-origin-005

background-origin - content-box keyword value

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Flags
image
Assertion
Background-origin with 'content-box' implies to position the background relative to the content box.

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3     <meta charset="utf-8">
 4     <title>CSS Backgrounds and Borders Test: background-origin - content-box keyword value</title>
 5     <link href="http://www.intel.com" rel="author" title="Intel">
 6     <link href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" rel="reviewer" title="Gérard Talbot"> <!-- 2012-11-09 -->
 7     <link href="http://www.w3.org/TR/css3-background/#the-background-origin" rel="help" title="3.8. Positioning Area: the 'background-origin' property">
 8     <link href="reference/background-origin-005-ref.htm" rel="match">
 9     <meta content="image" name="flags">
10     <meta content="Background-origin with 'content-box' implies to position the background relative to the content box." name="assert">
11     <style>
12         div {
13             position: absolute;
14         }
15         #ref-overlapped-red {
16             background-color: red;
17             height: 60px;
18             left: 30px;
19             top: 30px;
20             width: 60px;
21         }
22         #test-overlapping-green {
23             background-image: url(support/60x60-green.png);
24             background-origin: content-box;
25             background-repeat: no-repeat;
26             border: transparent dotted 5px;
27             height: 100px;
28             padding: 25px;
29             width: 100px;
30         }
31     </style>
32   </head>
33   <body>
34     <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
35     <div id="container">
36       <div id="ref-overlapped-red"></div>
37       <div id="test-overlapping-green"></div>
38     </div>
39   
40 
41 </body></html>