background-size-003

Value of 'auto' is used for y dimension in 'background-size'

WeasyPrint

This browser

Assertion
An 'auto' value for y dimension in 'background-size' is resolved by using the image's intrinsic ratio and the size provided for the x dimension.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml"><head>
 3         <title>CSS Test: Value of 'auto' is used for y dimension in 'background-size'</title>
 4         <link href="http://www.microsoft.com/" rel="author" title="Microsoft">
 5         <link href="http://www.w3.org/TR/css3-background/#the-background-size" rel="help">
 6         <meta content="" name="flags">
 7         <meta content="An 'auto' value for y dimension in 'background-size' is resolved by using the image's intrinsic ratio and the size provided for the x dimension." name="assert">
 8         <style type="text/css">
 9             .test
10             {
11                 width: 100px;
12                 height: 100px;
13                 background-repeat: no-repeat;
14                 background-image: url("support/red_color.png");
15                 background-size: 50px auto;
16             }
17             .reference
18             {
19                 margin-top: -100px;
20                 background: black;
21                 width: 50px;
22                 height: 50px;
23             }
24         </style>
25         </head>
26     <body>
27         <p>Test passes if there is no red visible on the page.</p>
28         <div class="test"></div>
29         <div class="reference"></div>
30     
31 
32 </body></html>