containing-block-005.xht (1722B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: Containing block for static positioned elements is nearest table cell ancestor</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-07 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details" /> 8 <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> 9 10 <meta name="assert" content="If the element's position is 'static', the containing block is formed by the content edge of the nearest table cell ancestor box." /> 11 <style type="text/css"> 12 #table 13 { 14 display: table; 15 } 16 #row 17 { 18 display: table-row; 19 } 20 #cell 21 { 22 background: red; 23 display: table-cell; 24 height: 100px; 25 width: 100px; 26 } 27 #cell div 28 { 29 background: green; 30 height: 100%; 31 position: static; 32 width: 100%; 33 } 34 </style> 35 </head> 36 <body> 37 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 38 <div id="table"> 39 <div id="row"> 40 <div id="cell"> 41 <div></div> 42 </div> 43 </div> 44 </div> 45 </body> 46 </html>