back to introduction
The same test, but using float:right instead of float:left.
paragraph.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
display:tableparagraph.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
paragraph.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
paragraph in flow, no new block formatting context. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
paragraph, in flow, new block formatting context with display:table. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
a real html table. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat |
div.tablediv {display:table; background:#ffd4cc;}
p.table-p { background:#ccc; display:table;}
table {background: #daf2e8;}
div#one {float:left; width:100px; height:200px; border:2px solid lime; background:#f1f1f1}
display:table is not supported. A possible alternative is the use of display:inline-block or display:inline-table.display:table is not supported. In order to establish a new block formatting context, elements must gain ‘haslayout’ — see On having layout. {zoom:1} is used here.display:table and the html table slide under the floated block. More odd, the paragraph between the two elements with display:table also slides under the floated block. Some debugging showed that this is caused by the linked style sheet having a title attribute assigned. Removing that attribute, and the browser works correctly, as illustrated by this test case. The computed width of the elements appear to large, however.display:table. Safari and Opera (and IE Windows) do one thing, Gecko based browsers and iCab do something else: Safari and Opera collapse the left or right margin, although they correctly compute the width of the element. This is correct, according to Section 9.5 (previous versions of the spec, up to the working draft released in November 2006 required no overlap between the margin-boxes; see the introduction for the details).Last modified: May 24 2010 03:10:37 GMT.