box-generation-001.xht (1546B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: Block-level elements generate principal block boxes with block boxes</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes" /> 8 <link rel="match" href="box-generation-001-ref.xht" /> 9 10 <meta name="assert" content="Block boxes can reside within a principal block box established by a block-level element; inline boxes are outside of the principal block box." /> 11 <style type="text/css"> 12 div div 13 { 14 background: blue; 15 width: 1in; 16 } 17 #span1 18 { 19 background: orange; 20 } 21 #span2 22 { 23 background: yellow; 24 float: left; 25 width: 0.5in; 26 } 27 </style> 28 </head> 29 <body> 30 <p>Test passes if the orange stripe is below the blue stripe and the yellow stripe is on the left-hand side of the orange stripe.</p> 31 <div id="div1"> 32 <div>Block box</div> 33 <span id="span1">Inline box</span> 34 <span id="span2">Float</span> 35 </div> 36 </body> 37 </html>