max-width-110.xht (1709B)
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: max-width - float and inline replaced element</title> 8 9 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> 10 <link rel="author" title="James Hopkins" href="http://idreamincode.co.uk/css21testsuite" /> 11 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths" title="10.4 Minimum and maximum widths: 'min-width' and 'max-width'" /> 12 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width" title="10.3.2 Inline, replaced elements" /> 13 <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> 14 15 <meta content="image" name="flags" /> 16 <meta content="If 'height' and 'width' both have computed values of 'auto' and the element also has an intrinsic width, then such intrinsic width is the used value of 'width'. If 'width' of a floating, non-replaced element computes to 'auto' but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert" /> 17 18 <style type="text/css"><![CDATA[ 19 div 20 { 21 background-color: red; 22 float: left; 23 } 24 25 img 26 { 27 height: auto; 28 max-width: 100px; 29 vertical-align: bottom; 30 width: auto; 31 } 32 ]]></style> 33 34 </head> 35 36 <body> 37 38 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 39 40 <div><img src="support/green200x200.png" alt="Image download support must be enabled." /></div> 41 42 </body> 43 </html>