On Sep 13, 2007, at 2:05 AM, sandy wrote:
> here is my site:
>
> http://www.westboundandweary.com/pca/support_pca/
>
> my question is about the image and caption i sent an email about
> earlier. my goal is to make that caption fit the width of whatever
> size
> image happens to be displayed.
> caption and image are both inside parent div floated right of
> unspecified width. i do not set specific width to the caption div
> so it
> will stretch according to the image size, it is on auto. the
> problem is
> when the caption div has only a little bit of text, it stretches to
> the
> correct width of the parent which is good (see the bottom image and
> caption example), but when it has a lot of text it is stretching it's
> div out past the image and stretching the parent (see the top image
> and
> caption example). how do i make the caption contents wrap to an
> unspecified width? is this possible?
Unfortunately for you, there is no way to do what you want. The auto
width of the floated div (image_and_caption) will always depend on
both the width of the image and the amount of text in the caption.
You'll have to think about another construction, one that will need a
set width on that div (or alternatively, keep all you captions short).
Just out of my sleeve:
.image_and_caption {
float:right;
width:220px;
border: 1px solid lime;
text-align:center;
margin: 0 -2% 1em 1em;
display:inline; /* for iExploder6 */
clear:right
}
Philippe
---
Philippe Wittenbergh
<http://emps.l-c-n.com>
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/