height-width-table-001a.xht (1626B)
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: height and width of element set to 'display: table'</title> 8 9 <!-- 10 Inspired by 11 http://test.csswg.org/suites/css2.1/20101210/html4/empty-cells-applies-to-007.htm 12 --> 13 14 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> 15 <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#height-layout" title="17.5.3 Table height algorithms" /> 16 <link rel="bookmark" href="http://lists.w3.org/Archives/Public/www-style/2011Jan/0178.html" title="[CSS21] Question on section 17.6.1 The separated borders model and width of inline-table" /> 17 <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> 18 19 <meta content="The content-box height and width of an empty element styled with display set to 'table' is given by its height and width properties when specified." name="assert" /> 20 21 <style type="text/css"><![CDATA[ 22 div#overlapped-red-reference 23 { 24 background-color: red; 25 height: 100px; 26 position: absolute; 27 width: 100px; 28 z-index: -1; 29 } 30 31 div#overlapping-green-test 32 { 33 background-color: green; 34 border: green solid 15px; 35 border-collapse: separate; 36 display: table; 37 height: 50px; 38 padding: 10px; 39 width: 50px; 40 } 41 ]]></style> 42 43 </head> 44 45 <body> 46 47 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 48 49 <div id="overlapped-red-reference"></div> 50 51 <div id="overlapping-green-test"></div> 52 53 </body> 54 </html>