I'm trying to get the .copy below to shrink-wrap to the width of the image:
HTML:
<div class="post">
<img src="some/image.png" />
<div class="copy">
<p>Morbi dignissim leo a erat tristique eu faucibus dolor commodo. Cras scelerisque, est quis molestie tempus, ante sem fringilla ante, non convallis quam mi ac metus. Donec rhoncus mattis consectetur. Maecenas cursus, dolor ut facilisis consequat, dolor quam interdum quam, vel lacinia arcu neque vel erat.</p>
</div>
</div>
CSS:
.post {
float: right;
}
The .post is floated, shrink-wrapping it to the width of its content. This works if there isn't much .copy but when the .copy gets long it expands the .post. Is there a way I can get the .copy to stay with the width of the image?
Unfortunately, the image width changes based on the page width so I can't set an actual sizes. I just want the image to define the .post width itself.
Is there a way to do this without resorting to javascript?