clear-applies-to-015.xht (1740B)
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: Clear applied to element with 'display' set to 'table-caption'</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/" /> <!-- 2013-01-10 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> 8 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> 9 10 <link rel="match" href="clear-applies-to-001-ref.xht" /> 11 12 <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'table-caption' because an anonymous table wrapper box will be generated for a misparented table-caption element and such anonymous table wrapper box creates a block formatting context. Clear will not apply to floats outside a block formatting context." /> 13 <style type="text/css"> 14 body {margin: 8px;} 15 16 p 17 { 18 float: left; 19 line-height: 1.25; 20 margin: 1em 0; 21 width: 320px; 22 } 23 24 #caption 25 { 26 background: blue; 27 clear: both; 28 color: blue; 29 display: table-caption; 30 height: 1in; 31 width: 1in; 32 } 33 </style> 34 </head> 35 <body> 36 <p>Test passes if there is a filled blue square to the right of this text.</p> 37 38 <div id="caption">C</div> 39 40 </body> 41 </html>