I am currently designing a website and I have envisioned a layout where there is a slideshow on the left side with corresponding text describing each slide on the right side. To achieve this, I am using flexbox for layout and absolute positioning for the images in the slideshow. However, I am facing an issue where the containing div does not fully wrap around the slideshow images, causing them to overflow the frame. Is there a way to make the div completely encapsulate the slideshow images while maintaining a maximum and minimum width set in the CSS?
Below is the current structure of my code:
HTML:
<div class="container">
<div class="content">
<div class="slides">
<img src="http://placehold.it/2048x1365">
<img src="http://placehold.it/2048x1365">
</div>
</div>
<div class="content">
<p>This is some content.</p>
<p>This is some more content.</p>
<p>This is some more content.</p>
<p>This is some more content.</p>
</div>
</div>
CSS:
.container {
display: flex;
justify-content: center;
margin: 30px;
}
.content {
background: red;
flex: auto;
flex-direction: column;
min-width: 30em;
max-width: 38em;
padding: 10px;
margin: 5px;
}
.slides {
position: relative;
width: 100%;
height: 100%;
}
.content img {
width: 100%;
height: auto;
position: absolute;
display: block;
}
You can view the example on jsfiddle here.