W3C home > Mailing lists > Public > www-style@w3.org > September 2009

Re: Shrink to fit

From: Eduard Pascual <herenvardo@gmail.com>
Date: Thu, 24 Sep 2009 22:30:35 +0200
Message-ID: <6ea53250909241330y7179885amf0c3a6ebf3cbebeb@mail.gmail.com>
To: Neville Hillyer <n.hillyer@open.ac.uk>
Cc: www-style@w3.org
On Thu, Sep 24, 2009 at 5:30 PM, Neville Hillyer <n.hillyer@open.ac.uk> wrote:
> This is my first post to this list so I hope you will excuse any minor
> protocol infringements.
>
> For some while I have been concerned that CSS 2.1 'shrink-to-fit' cannot be
> made to work as many would wish except on a few old browsers. An outer box
> cannot be made to shrink around inner boxes except in the special case of
> the inner boxes all being on one line. I have produced a web page on this
> at: http://links.open.ac.uk/www/shrink-wrap/
>
> I am not proposing changes which would affect existing designs but I am
> requesting an additional CSS 3 option which would invoke the performance
> explained on my page. I accept that this would add a small amount of
> complexity and, if imprudently implemented, may have speed implications but,
> nevertheless, I think this more intuitive method is sufficiently important
> to warrant this.
>
> Initial indications are that although those responsible may discuss this
> proposal it is unlikely to get much further unless others join with me and
> support it.

First of all, I'd like to make sure your proposal is what I think it
is. If I understood it correctly, the idea would be to have the yellow
box shrink further when the outer (maroon) box already forces the blue
one to a second line; but the shrink-to-fit would still never cause on
its own the content to break into more lines; am I right?
If that's what you are proposing, then I must agree 100% with having
an option for that. Looking at the FF3 example: the box does neither
shrink nor fit the contents, despite both things are what should be
expected from something called "shrink-to-fit". I can't think of any
case where FF3 behavior would be desired, but on almost all the sites
I'm working something with FF2 behavior would be a bless (actually, I
could even get rid of some <table>-based layouts).

To summarize my use-cases, they all boil down to having a sane way to
define the width for navigation side-bars without wasting screen real
state. Also I built a site last June[1] where I had to hardcode an
approximate width to center a "drop-down" menu on the screen: being
able to use shrink-to-fit instead of hardcoded widths to trigger
"margin: auto"'s block centering behavior would be a bless and would
allow sites to either look better and be more resilient, or get rid of
javascript-based re-positioning.

Just my thoughts

Regards,
Eduard Pascual

[1]http://www.abc-jitkasplayground.com/  The relevant block is the
centered menu on the home page.
Received on Thursday, 24 September 2009 20:31:36 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:21 GMT