background-size-cover-003.html (1066B)
1 <!DOCTYPE html> 2 <title>CSS Test: background-size: cover with zero-sized background positioning area.</title> 3 <link rel="help" href="https://drafts.csswg.org/css-backgrounds/#valdef-background-size-cover"> 4 <link rel="help" href="https://github.com/w3c/csswg-drafts/issues/4049"> 5 <link rel="help" href=" https://bugzilla.mozilla.org/show_bug.cgi?id=1559094"> 6 <link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> 7 <link rel="author" href="https://mozilla.org" title="Mozilla"> 8 <link rel="match" href="background-size-cover-003-ref.html"> 9 <style> 10 body { margin: 0 } 11 div { 12 background-size: cover; 13 background-repeat: no-repeat; 14 background-position: top left; 15 background-origin: content-box; 16 background-image: url(/images/green-100x50.png); 17 } 18 #test1 { 19 height: 0; 20 width: 100px; 21 padding-bottom: 100px; 22 } 23 24 #test2 { 25 height: 100px; 26 width: 0; 27 padding-right: 100px; 28 } 29 #test3 { 30 height: 0; 31 width: 0; 32 padding-right: 100px; 33 padding-bottom: 100px; 34 } 35 </style> 36 <div id="test1"></div> 37 <div id="test2"></div> 38 <div id="test3"></div>