On Aug 1, 2006, at 11:05 PM, Joe D'Andrea wrote:

An element with display:table shrink-wraps the width, just as a real table would do. And Opera is known to be more aggressive in this than some other browsers.


Aye. But if each item/link has a minimum width, wouldn't that count
for something? Put another way, if I had a table row with min-width
cells, would it wrap to two rows?

It is a bit more complicated. When you use display:table; browsers do this:
<http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes>
aka, add a few anonymous boxes around your group of elements, one of them being a table-cell.

That table-cell wraps around all your floated blocks.
So that is different than a real table, which would contain a whole series of table-cells.

If you put your series of links in a (one) real table-cell, and use the same styling (float), odds are that you'd see similar behaviour/ differences between browsers.

The HTML and CSS 'table' model is a pretty complex thing, and all browsers use different algos to compute width (and are reluctant to change anything...).


And on the side, you won't need to clear those floated elements as
{display:table} establishes a new block formatting context and
contains the floated blocks any way.

True. That note was actually based on IE (which won't use display:
table but an entirely different approach, and still needed to clear
the float). I didn't need to mention it in the context of this
particular issue.

Unrelated to your test case, as IE doesn't do display:table anyway.
You'll probably need a 'haslayout' trigger for IE, which would achieve the same: containing the floats (and that is a bug in IE, anyway). [1]

[1] see my little exercises here:
<http://dev.l-c-n.com/IEW/simulations.php>
which is partly a spin off from this article:
<http://www.satzansatz.de/cssd/onhavinglayout.html>

PS - If you know the number of links, and their minimum-width, you could give your <p> a minimum width as well.

Philippe
---
Philippe Wittenbergh
<http://emps.l-c-n.com>





******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************

Reply via email to