Is it possible to extend an image beyond its parent container on both the top and bottom while maintaining responsiveness and containing remaining content within the parent? I've managed to achieve this effect on the top but struggle with the bottom. Any suggestions on how to accomplish this without breaking the grid layout?
I experimented with absolute positioning, which caused layout issues. Negative margins worked for the top extension but not the bottom. Here is a basic code snippet of what I have so far available on jsfiddle:
.band {
background-color: #ddd;
margin-top: 100px;
}
.contain {
margin: 0 auto;
max-width: 600px;
}
.row {
align-content: flex-start;
clear: both;
display: flex;
flex-flow: row wrap;
overflow: visible;
}
.col {
width: 50%;
}
.col-image {
margin-top: -20px;
}
p {
padding: 20px;
}
img {
display: block;
height: auto;
max-width: 100%;
}
<div class="band">
<div class="contain">
<div class="row">
<div class="col">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div class="col col-image">
<img src="https://via.placeholder.com/800x450?text=fpo">
</div>
</div>
</div>
</div>