W3C home > Mailing lists > Public > www-style@w3.org > April 2012

Re: [css3-flexbox] handling whitespace between items in a flexbox

From: Brad Kemper <brad.kemper@gmail.com>
Date: Sat, 7 Apr 2012 11:27:47 -0700
Message-Id: <22046B5E-42A2-4422-8CAA-B7EAC40194FD@gmail.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
To: Daniel Holbert <dholbert@mozilla.com>

On Apr 6, 2012, at 5:22 PM, Daniel Holbert <dholbert@mozilla.com> wrote:

> On 04/06/2012 05:10 PM, Brad Kemper wrote:
>> Wouldn't you want to also collapse away any whitespace before and after any untagged non-whitespace content?
> 
> I don't think so, no.
> 
> If the "white-space" propety has its normal value, then it doesn't
> matter whether we collapse leading/trailing whitespace -- it's at the
> beginning or end of a block (the anonymous flexbox item), and I think
> the block will collapse it for us.
> 
> Note that the following two divs will render identically (with
> white-space at its default value):
>    <div>abc</div>
>    <div>
>      abc
>    </div>

Huh. How about that. I have a deeply ingrained habit of not doing that with my <p> tags, so that I don't end up with a space at the beginning of a paragraph. I know I used to run into that before (ie6 maybe?), where it collapsed to one space instead of none, but it seems like it isn't a problem any more. 

> ...which means we don't have to beautify our anonymous flexbox items to
> make them look like the first div.
> 
> Now, if we've got "white-space: pre", then I'd say we explicitly do
> _not_ want to collapse the leading/trailing white-space, since the
> author presumably wanted it there.
> 
> So -- it's safest to just leave leading/trailing whitespace uncollapsed,
> IMHO.

OK, agreed. 
Received on Saturday, 7 April 2012 18:28:18 GMT

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