background_position_three_four_values

'Background-position' with three and four values

WeasyPrint

This browser

Assertion
If three or four values are given to 'background-position', then each percentage or length value represents an offset from the edge specified by the keyword.

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: 'Background-position' with three and four values</title>
 4         <link href="http://www.microsoft.com/" rel="author" title="Microsoft">
 5         <link href="http://www.w3.org/TR/css3-background/#background-position" rel="help">
 6         <meta content="" name="flags">
 7         <meta content="If three or four values are given to 'background-position', then each percentage or length value represents an offset from the edge specified by the keyword." name="assert">
 8         <style type="text/css">
 9             div
10             {
11                 width: 3in;
12                 height: 2in;
13                 border: thick solid black;
14                 margin: 10px;
15                 background-image: url("support/blue_color.png");
16                 background-repeat: no-repeat;
17             }
18             .reference
19             {
20                 background-position: right center;
21             }
22             .test1
23             {
24                 background-position: left 2in center;
25             }
26             .test2
27             {
28                 background-position: left 2in top 50%;
29             }
30         </style>
31     </head>
32     <body>
33         <p>Test passes if the content of the three black boxes is identical.</p>
34         <div class="reference"></div>
35         <div class="test1"></div>
36         <div class="test2"></div>
37     
38 </body></html>