inlines-013

Inline box model: space taken by images before floats

WeasyPrint

This browser

Flags
image

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: Inline box model: space taken by images before floats</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/013.html" type="text/html">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#inline-boxes">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position">
 9   <meta name="flags" content="image">
10   <style type="text/css">
11    div { font: 64px/1 monospace; }
12    #control1 { position: absolute; top: 100px; }
13    #control2 { position: absolute; top: 164px; }
14    #container { position: absolute; top: 100px; width: 0; } /* width: 0; so that the float can't arguably be on the first line */
15    #test { float: left; }
16   </style>
17  </head>
18  <body>
19   <p>You should see the word PASS below, with the word fail crossed out with Xs on the line below.</p>
20   <div id="control1">PASS</div>
21   <div id="control2">FAIL</div>
22   <div id="container">
23    <img src="support/1x1-white.png" alt="(image test failed)"> <!-- this should generate a line box 64px high -->
24    <div id="test">XXXX</div> <!-- this will overlap the PASS if it ends up on the previous line, otherwise it will overlap the fail -->
25   </div>
26  </body>
27 </html>