I am working on an article that includes an image with a description. The challenge is that the description should not exceed the width of the image, but since the image width varies, fixing the width with a class .article-image is not a viable solution.
article {
width: 600px;
margin: 0 auto;
}
.leadtext {
font-weight: 600;
margin-bottom: 10px;
}
.article-image {
float: left;
margin: 0 10px 10px 0;
}
.article-image img {
display: inline-block;
}
.article-image>div {
font-size: 0.8em;
font-style: italic;
}
<article>
<h1>Headline</h1>
<div class="leadtext">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua</div>
<div>
<div class="article-image">
<img src="https://placehold.it/100x100">
<div>Lorem ipsum dolor sit amet, consetetur sadipscing elitr | © author</div>
</div>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
</article>