Re: [css-d] Fit to width

2011-10-27 Thread David Hucklesby
On 10/26/11 3:08 AM, Philip TAYLOR (Webmaster, Ret'd) wrote: I am looking for a technique that will allow me to generate a DIV, the width of which is the width of its widest non-shrinkable immediate child element; the DIV will always be floated. [...] Sorry for the delay - I was out of

[css-d] Fit to width

2011-10-26 Thread Philip TAYLOR (Webmaster, Ret'd)
I am looking for a technique that will allow me to generate a DIV, the width of which is the width of its widest non-shrinkable immediate child element; the DIV will always be floated. For example, consider the following : DIV style=float: ... IMG src=... alt=...

Re: [css-d] Fit to width

2011-10-26 Thread Jukka K. Korpela
26.10.2011 13:08, Philip TAYLOR (Webmaster, Ret'd) wrote: I am looking for a technique that will allow me to generate a DIV, the width of which is the width of its widest non-shrinkable immediate child element; the DIV will always be floated. [...] The image has a natural width, which for

Re: [css-d] Fit to width

2011-10-26 Thread Ingo Chao
Jukka already presented a solution without the float, but with a css table. In your setting, you wanted the floating div to have a shrink-to-fit width (CSS2.1: 10.3.5) that equals to the width of the image, so the width of the text without breaks must not become the preferred width of the float.