css3-background-size-contain-ref.html (705B)
1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title>CSS3 background-size:contain</title> 6 <link rel="author" title="Yue Hu" href="mailto:miniwade514@gmail.com" /> 7 <link rel="reviewer" title="Dayang Shen" href="mailto:shendayang@baidu.com"> <!-- 2013-09-03 --> 8 <style> 9 div { 10 width: 200px; 11 height: 250px; 12 border: 5px dashed black; 13 overflow: hidden; 14 } 15 16 img { 17 width: 200px; 18 height: 200px; 19 } 20 </style> 21 </head> 22 <body> 23 <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> 24 <div> 25 <img src="../support/60x60-green.png" alt="" /> 26 </div> 27 </body> 28 </html>