padding-applies-to-013a.xht (1887B)
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: Padding applied to element with display table and with a set width</title> 8 9 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> 10 <!-- 11 Inspired by Known issues at 12 http://caniuse.com/#feat=css-table 13 --> 14 <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#separated-borders" title="17.6.1 The separated borders model" /> 15 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#padding-properties" title="8.4 Padding properties: 'padding-top', 'padding-right', 'padding-bottom', 'padding-left', and 'padding'" /> 16 <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> 17 18 <meta content="The width of a CSS table is the distance from the left inner padding edge to the right inner padding edge: so the width of a CSS table does not include its padding area." name="assert" /> 19 20 <style type="text/css"><![CDATA[ 21 div#red-overlapped 22 { 23 background-color: red; 24 height: 100px; 25 position: absolute; 26 width: 100px; 27 z-index: -1; 28 } 29 30 div#green-overlapping-table 31 { 32 background-color: green; 33 display: table; 34 padding: 25px; 35 table-layout: fixed; 36 width: 50px; 37 } 38 39 div.table-row {display: table-row;} 40 41 div.table-cell 42 { 43 display: table-cell; 44 height: 25px; 45 } 46 ]]></style> 47 48 </head> 49 50 <body> 51 52 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 53 54 <div id="red-overlapped"></div> 55 56 <div id="green-overlapping-table"> 57 <div class="table-row"> 58 <div class="table-cell"></div><div class="table-cell"></div> 59 </div> 60 <div class="table-row"> 61 <div class="table-cell"></div><div class="table-cell"></div> 62 </div> 63 </div> 64 65 </body> 66 </html>