containing-block-020.xht (2161B)
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 Blocks - Block-level elements position based on right-to-left direction and parent element is absolute</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-10-10 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details" /> 8 <link rel="match" href="containing-block-020-ref.xht" /> 9 10 <meta name="assert" content="When the nearest (closest within document containment hierarchy) positioned ancestor of an absolutely positioned element is a block-level element, then the containing block of such absolutely positioned element is formed by the padding edge of such nearest (closest) positioned ancestor." /> 11 <style type="text/css"> 12 div 13 { 14 border: solid black; 15 padding: 1in; 16 position: absolute; 17 width: 0; 18 } 19 span 20 { 21 display: block; 22 } 23 #span1 24 { 25 direction: rtl; 26 } 27 span span 28 { 29 background: blue; 30 height: 1in; 31 left: auto; 32 position: absolute; 33 top: auto; 34 width: 1in; 35 } 36 /* 37 The span#span1 element determines, conditions (§10.3.7 and §10.6.4) 38 the 'top: auto' and 'left: auto' coordinates while the wrapping 39 div's padding box forms the containing block geometry/area. 40 */ 41 </style> 42 </head> 43 <body> 44 <p>Test passes if a filled blue square is in the <strong>lower-left corner</strong> of an hollow black square.</p> 45 <div> 46 <span id="span1"> 47 <span></span> 48 </span> 49 </div> 50 </body> 51 </html>