I'm trying to achieve the following layout (note there is text/content above and below the image):
The main content/row is in gray. It is 800px max width and centered. How can I make the image align with the main div to the left but have it overflow/stretch to the right 100% to the end of the browser window? I am looking for a CSS only solution if possible without JS.
body {
text-align: center;
}
.main {
width: 100%;
max-width: 800px;
margin: 0 auto;
padding: 0 15px;
position: relative;
overflow: visible;
}
img {
width: 100%;
position: absolute;
left: 0;
}
<div class="main">
<img src="https://via.placeholder.com/300x100" />
</div>
but cannot get it to work. Please note, the layout is responsive.