background-size-011

background-size - one value at maximum

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Flags
image
Assertion
Check if 'background-size' is '100%', maximum width of the positioning area in percentage, then such value is the width of the corresponding image and the second value (corresponding to the height of the background image) is assumed to be 'auto'. An 'auto' value for one dimension is resolved by using the image's intrinsic ratio (in this test, the image's intrinsic ratio is 1:1) and (multiplied by) the size of the other dimension. Therefore the used height of the background-size in this test should be 100px.

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3     <meta charset="utf-8">
 4     <title>CSS Backgrounds and Borders Test: background-size - one &lt;percentage&gt; value at maximum</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-size" rel="help" title="3.9. Sizing Images: the 'background-size' property">
 8     <link href="reference/ref-filled-green-100px-square.htm" rel="match">
 9     <meta content="image" name="flags">
10     <meta content="Check if 'background-size' is '100%', maximum width of the positioning area in percentage, then such value is the width of the corresponding image and the second value (corresponding to the height of the background image) is assumed to be 'auto'. An 'auto' value for one dimension is resolved by using the image's intrinsic ratio (in this test, the image's intrinsic ratio is 1:1) and (multiplied by) the size of the other dimension. Therefore the used height of the background-size in this test should be 100px." name="assert">
11     <style>
12         div {
13             height: 100px;
14             width: 100px;
15         }
16         #ref-overlapped-red {
17             background-color: red;
18         }
19         #test-overlapping-green {
20             background-image: url(support/50x50-green.png);
21             background-repeat: no-repeat;
22             background-size: 100%;
23             bottom: 100px;
24             position: relative;
25         }
26     </style>
27   </head>
28   <body>
29     <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
30     <div id="ref-overlapped-red"></div>
31     <div id="test-overlapping-green"></div>
32   
33 
34 </body></html>