- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Wed, 11 Apr 2012 13:19:25 -0700
- To: Daniel Holbert <dholbert@mozilla.com>
- Cc: www-style list <www-style@w3.org>
On Wed, Apr 11, 2012 at 1:12 PM, Daniel Holbert <dholbert@mozilla.com> wrote: > Hi www-style, > > Basic question: what width should we use for the "width:auto" flexbox here: > > <div style="width: 500px"> > <div style="display: flexbox; width: auto; background: green"> > abc > </div> > </div> > > Should it be the shrink-wrapped width of its contents "abc", or the size > of its containing block (500px)? (per CSS 2.1 10.3.3 [1]) > > A while ago, I (perhaps incorrectly) got the impression from the spec > that auto-width flexboxes were supposed to shrinkwrap their contents. > However, I've just noticed that I can't find any mention of auto widths > in the current ED or WD, and the webkit nightly implementation doesn't > shrink-wrap by default. > > So, I'm assuming my old "auto = shrink-wrap" interpretation is incorrect > and/or outdated, and we're instead supposed to follow CSS 2.1 10.3 on > this. I'm hoping for confirmation that my updated interpretation is > correct. :) > > Thanks, > ~Daniel > > [1] http://www.w3.org/TR/CSS21/visudet.html#blockwidth Your updated interpretation is correct. Flexboxes size as blocks by default. You only shrinkwrap if you're in a condition that normally shrinkwraps (like float, or being an inline-flexbox). ~TJ
Received on Wednesday, 11 April 2012 20:20:18 UTC