css3-background-size-contain

CSS3 background-size:contain

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3   <meta charset="UTF-8">
 4   <title>CSS3 background-size:contain</title>
 5   <link href="mailto:miniwade514@gmail.com" rel="author" title="Yue Hu">
 6   <link href="mailto:shendayang@baidu.com" rel="reviewer" title="Dayang Shen"> <!-- 2013-09-03 -->
 7   <link href="http://www.w3.org/TR/css3-background/#the-background-size" rel="help">
 8   <link href="reference/css3-background-size-contain-ref.htm" rel="match">
 9   <style>
10     div {
11       width: 200px;
12       height: 250px;
13       border: 5px dashed black;
14       overflow: hidden;
15       background-image: url(support/60x60-green.png);
16       background-size: contain;
17       background-repeat: no-repeat;
18     }
19   </style>
20 </head>
21 <body>
22   <p>The test passes if the green box image is scaled to fit the width of the outer box, while preserving its intrinsic aspect ratio.</p>
23   <div></div>
24 
25 
26 </body></html>