Horizontal shrink-wrapping of blocks

Today I ran into a case where I needed a box to do the following:

1)  Shrink-wrap horizontally.
2)  Be in-flow.
3)  Be a block-level box (so that following floats didn't affect horizontal
     positioning of the text in the box).

The use case was for creating a fieldset-like layout for a website.  The above 
criteria needed to apply to the box generated by the "legend" element (the header).

The only way I've found of doing this within CSS2.1 is to make the legend 
"display:table" or "display:table-cell".  This has issues in general 
application, though if the content inside, outside, or next to the legend has 
table display types.

So for CSS3 I think it would be a good idea to have an explicit "shrink-wrap" 
width value, which would allow this to be done painlessly.  I know the idea has 
been mentioned before, but I'd like to add another voice in support...

-Boris

Received on Monday, 2 May 2005 17:38:59 UTC