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

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 UTC