background-origin-004

background-origin - border-box keyword value

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

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

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3     <meta charset="utf-8">
 4     <title>CSS Backgrounds and Borders Test: background-origin - border-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-004-ref.htm" rel="match">
 9     <meta content="image" name="flags">
10     <meta content="Background-origin with 'border-box' implies to position the background relative to the border box." name="assert">
11     <style>
12         div {
13             position: absolute;
14         }
15         #ref-overlapped-red {
16             background-color: red;
17             height: 60px;
18             width: 60px;
19         }
20         #test-overlapping-green {
21             background-image: url(support/60x60-green.png);
22             background-origin: border-box;
23             background-repeat: no-repeat;
24             border: transparent dotted 5px;
25             height: 100px;
26             padding: 25px;
27             width: 100px;
28         }
29     </style>
30   </head>
31   <body>
32     <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
33     <div id="container">
34       <div id="ref-overlapped-red"></div>
35       <div id="test-overlapping-green"></div>
36     </div>
37   
38 
39 </body></html>