background-position-applies-to-007a.xht (1928B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 5 <head> 6 7 <title>CSS Test: Background-position applied to elements with 'display' set to 'table-cell'</title> 8 9 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> 10 <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties" title="14.2.1 Background properties: 'background-color', 'background-image', 'background-repeat', 'background-attachment', 'background-position', and 'background'" /> 11 12 <meta name="flags" content="image" /> 13 <meta name="assert" content="The 'background-position' property applies to elements with 'display' set to 'table-cell'." /> 14 15 <style type="text/css"><![CDATA[ 16 div#table {display: table;} 17 18 div#tbody {display: table-row-group;} 19 20 div.tr {display: table-row;} 21 22 div.td 23 { 24 display: table-cell; 25 height: 1in; 26 width: 1in; 27 } 28 29 div#tested-cell 30 { 31 background-image: url('support/blue96x96.png'); 32 background-position: bottom right; 33 background-repeat: no-repeat; 34 border-bottom: white solid 96px; 35 /* 36 The goal/challenge in this test is to verify 37 that such white border-bottom does not 38 cover the background-image. 39 The background-image should "start" being 40 painted at bottom right corner of 41 padding-box of element and not "start" 42 being painted at bottom right corner of 43 its border-box. 44 */ 45 display: table-cell; 46 height: 2in; 47 width: 1in; 48 } 49 ]]></style> 50 </head> 51 52 <body> 53 54 <p>Test passes if there is a blue square.</p> 55 56 <div id="table"> 57 <div id="tbody"> 58 <div class="tr"> 59 <div class="td"></div><div class="td"></div> 60 </div> 61 <div class="tr"> 62 <div class="td"></div><div id="tested-cell"></div> 63 </div> 64 </div> 65 </div> 66 67 </body> 68 </html>