W3C home > Mailing lists > Public > www-style@w3.org > May 2005

Horizontal shrink-wrapping of blocks

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Mon, 02 May 2005 12:38:43 -0500
Message-ID: <427665A3.1060409@mit.edu>
To: www-style@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:37 GMT