| 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 |
| 3 <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
| 5 <head> |
| 6 |
| 7 <title>CSS Test: 'shrink-to-fit' width of absolutely positioned, non-replaced
elements - direction (right-to-left), float and max-width</title> |
| 8 |
| 9 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserB
ugsSection/css21testsuite/" /> |
| 10 <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@g
mx.de" /> |
| 11 <link rel="help" title="Section 10.3.7 Absolutely positioned, non-replaced ele
ments" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" /> |
| 12 <link rel="help" title="Section 10.3.5 Width of floating, non-replaced element
s" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> |
| 13 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"
/> |
| 14 <link rel="match" href="absolute-non-replaced-width-021-ref.xht" /> |
| 15 <meta content="When direction is right-to-left and 'right' is set to static po
sition and 'width' and 'left' are 'auto', then the used value of 'width' is give
n by 'shrink-to-fit' width calculation. If 'width' of an floating, non-replaced
element in normal flow computes to 'auto', then the used value of 'width' is als
o given by 'shrink-to-fit' width calculation. If 'width' of a floating, non-repl
aced element in normal flow is given by 'shrink-to-fit' width calculation, then
such calculated width can be furthermore constrained, reduced by a max-width dec
laration. If width of an absolutely positioned, non-replaced element resorts to
'shrink-to-fit' width calculation but its own child uses a constrained length re
sulting from a max-width declaration, then such constrained length will define t
he preferred width in 'shrink-to-fit' width calculation." name="assert" /> |
| 16 <meta content="ahem" name="flags" /> |
| 17 |
| 18 <style type="text/css"><![CDATA[ |
| 19 body |
| 20 { |
| 21 direction: rtl; |
| 22 margin: 8px; |
| 23 } |
| 24 |
| 25 p {direction: ltr;} |
| 26 |
| 27 div#outer-abs-pos |
| 28 { |
| 29 background-color: red; |
| 30 font: 30px/4 Ahem; |
| 31 left: auto; |
| 32 position: absolute; |
| 33 right: auto; |
| 34 /* |
| 35 right is set to static position: it should be 8px from |
| 36 the right-hand side of document box (at body's margin-right) |
| 37 */ |
| 38 width: auto; |
| 39 } |
| 40 |
| 41 div#inner-floated |
| 42 { |
| 43 background-color: green; |
| 44 float: left; |
| 45 max-width: 4em; |
| 46 } |
| 47 ]]></style> |
| 48 |
| 49 </head> |
| 50 |
| 51 <body> |
| 52 |
| 53 <p>Below, on the right edge of the page, there should be a green square. In th
e middle of such green square, a black horizontal stripe should be traversing it
and protruding out of it toward the left. There should be no red in this page.<
/p> |
| 54 |
| 55 <div id="outer-abs-pos"> |
| 56 <div id="inner-floated">12345678</div> |
| 57 </div> |
| 58 |
| 59 </body> |
| 60 </html> |
| OLD | NEW |