| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x
html1/DTD/xhtml1-strict.dtd"> |
| 2 <html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 <head> |
| 4 <title>CSS Test: Absolutely positioned, non-replaced elements, solve for
'bottom'</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-08-31 --> |
| 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-r
eplaced-height" /> |
| 8 <link rel="match" href="absolute-non-replaced-height-003-ref.xht
" /> |
| 9 |
| 10 <meta name="flags" content="" /> |
| 11 <meta name="assert" content="When 'margin-top' and 'margin-bottom' are s
et to '0' the 'bottom' value resolves to the remaining space within the containi
ng block." /> |
| 12 <style type="text/css"> |
| 13 #div1 |
| 14 { |
| 15 border: solid black; |
| 16 height: 3in; |
| 17 position: relative; |
| 18 width: 3in; |
| 19 } |
| 20 div div |
| 21 { |
| 22 position: absolute; |
| 23 top: 1in; |
| 24 bottom: auto; |
| 25 height: 1in; |
| 26 margin-top: auto; |
| 27 margin-bottom: auto; |
| 28 background: blue; |
| 29 width: 100%; |
| 30 } |
| 31 |
| 32 /* |
| 33 " |
| 34 'bottom' is 'auto', 'top' and 'height' are not 'auto', |
| 35 then set 'auto' values for 'margin-top' and 'margin-bottom' to 0 |
| 36 and solve for 'bottom' |
| 37 " |
| 38 |
| 39 Therefore, bottom used value must be 1in |
| 40 */ |
| 41 </style> |
| 42 </head> |
| 43 <body> |
| 44 <p>Test passes if a blue rectangle is <strong>vertically centered</stron
g> in an hollow black square.</p> |
| 45 <div id="div1"> |
| 46 <div></div> |
| 47 </div> |
| 48 </body> |
| 49 </html> |
| OLD | NEW |