On Mon, Aug 20, 2012 at 2:17 PM, Simon Sapin <simon.sapin@kozea.fr> wrote: > Le 20/08/2012 12:05, Giuseppe Bilotta a écrit : > >> (Of course, all this would not >> be an issue if CSS had a way to specify that a container should wrap >> its content 'tightly'.) > > > Do you mean "width: fit-content" as defined in css3-sizing? > http://dev.w3.org/csswg/css3-sizing/#width-height-keywords >From a cursory reading, this seems to look like what I'm trying to achieve. > Until fit-content is supported well enough, you can get the same behavior > with floats or inline-blocks. (But of course this comes attached with all > the other behaviors of such boxes.) Neither floats nor inline-blocks suffice to achieve what I want. I do use inline-blocks, the #container wraps a number of divs which have display: inline-block; however, if the #content is not sized _exactly_ as the number of blocks (+ margins) that would fit inside the viewport, I get extra whitespace inside the #container, which I don't want. This is why I have to manually specify the #content (max-)width depending on the viewport width and based on the (fixed) width of its inline-blocks. It does seem that the fit-content would be what I need. I guess I should write an extra rule (after all the media queries), with #content { max-width: fit-content }, and wait for it to be supported. Thanks for the pointer. -- Giuseppe "Oblomov" BilottaReceived on Monday, 20 August 2012 12:34:43 GMT
This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:58 GMT