W3C home > Mailing lists > Public > www-style@w3.org > February 2008

Re: Overflow and Margins

From: L. David Baron <dbaron@dbaron.org>
Date: Sun, 3 Feb 2008 13:28:03 -0800
To: Brad Kemper <brkemper@comcast.net>
Cc: Ben Cotterell <ben.cotterell@antplc.com>, "'CSS Style'" <www-style@w3.org>
Message-ID: <20080203212803.GA4899@ridley.dbaron.org>

On Sunday 2008-02-03 12:58 -0800, Brad Kemper wrote:
>
> On Feb 3, 2008, at 2:06 AM, Ben Cotterell wrote:
>> You can get that effect already by wrapping the contents in a
>> shrink-to-fit container (as I think you said).
>
> Bruno Fassino said that, and L. David Baron said it wouldn't work (it does 
> seem to if I used padding on the wrapper, though, instead of margin).

It's not that it wouldn't work, it's that it would cause other
problems.  In particular:

  <div style="overflow: scroll">
    <div style="display:table-cell"> <!-- shrink-to-fit wrapper -->

      <div style="width:2000px; background:green; margin: 50px">wide!</div>

      This is text that ought to wrap at the width of its
      overflow:scroll container (and would without the
      shrink-to-fit wrapper), but instead it doesn't wrap until it
      hits the 2000px width of the overflowing content!

    </div>
  </div>

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Sunday, 3 February 2008 21:28:54 GMT

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