summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/CSS2/normal-flow/max-width-110.xht
blob: 2b96eab362d116048f1c0b7cf1eccfeea7f48ace (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

 <head>

  <title>CSS Test: max-width - float and inline replaced element</title>

  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
  <link rel="author" title="James Hopkins" href="http://idreamincode.co.uk/css21testsuite" />
  <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'" />
  <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width" title="10.3.2 Inline, replaced elements" />
  <link rel="match" href="../reference/ref-filled-green-100px-square.xht" />

  <meta content="image" name="flags" />
  <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" />

  <style type="text/css"><![CDATA[
  div
  {
  background-color: red;
  float: left;
  }

  img
  {
  height: auto;
  max-width: 100px;
  vertical-align: bottom;
  width: auto;
  }
  ]]></style>

 </head>

 <body>

  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>

  <div><img src="support/green200x200.png" alt="Image download support must be enabled." /></div>

 </body>
</html>