block-in-inline-002.xht (1470B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: CSS: Blocks Within Inlines - Backgrounds</title> 5 <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact" /> 6 <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> 7 <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 --> 8 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level" /> 9 <link rel="match" href="block-in-inline-001-ref.xht" /> 10 11 <meta name="assert" content="When an inline box contains a block box, 12 the inline box is broken around the box and its background is drawn 13 only behind the inline's pieces, not behind the block."/> 14 <style type="text/css"> 15 td { border: solid black; color: black; padding: 0; background: green; } 16 .inline { display: inline; background: lime; } 17 .block { display: block; } 18 .a, .c { background: lime; } 19 .b { background: green; } 20 </style> 21 </head> 22 <body> 23 <p>The following two boxes should look identical.</p> 24 <table> 25 <tr> 26 <td> 27 <span class="inline">Line 1<span class="block">Line 2</span>Line 3</span> 28 </td> 29 <td> 30 <div class="a">Line 1</div> 31 <div class="b">Line 2</div> 32 <div class="c">Line 3</div> 33 </td> 34 </tr> 35 </table> 36 </body> 37 </html>