Need help with creating a webpage layout featuring two text boxes side by side, with the main content adjusting its width accordingly.
The issue arises when adding images, as they do not scale proportionally and end up at the bottom of the smaller box, creating a large empty space between the text and image.
Is there a straightforward solution to make the images scale along with the text, or should I consider an alternative approach?
Thank you for your assistance! :)
.container {
width: 600px;
}
.long-text {
overflow: hidden;
width: 100%;
background: white;
}
.long-text p {}
.long-text img {
width: auto;
max-height: 400px;
}
.right-column {
width: 200px;
float: right;
background: green;
padding: 5px 0 0 18px;
}
<div class="container">
<div class="long-text">
<div class="right-column">
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer...
</p>
</div>
<p>
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
</p>
<img src="https://placeimg.com/640/480/any">
<p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable
</p>
<p>
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of...
</p>
</div>
</div>
JS filddle: https://jsfiddle.net/marginaalivirhe/d8yLko24/8/