I need to create a two column layout where:
Left column has an image which fills the entire area;
The content in this column is not scrollable.
Right column has text and images. The content of this column is scrollable when it is long.
So when I move the browser scroll bar the right content moves but the image on the left column stays always the same and filling the entire area.
Is this possible?
This is what I have at the moment:
body{
margin: 0;
padding: 0;
}
.left, .right {
float: left;
width: 50%;
}
.left img {
height: auto;
max-width: 100%;
outline: 0;
}
<div class="left">
<img src="image.jpg" />
</div>
<div class="right">
<p>Long content</p>
</div>
Use position:fixed for the left div and padding-left:50% for the right div.
Fiddle: http://jsfiddle.net/3phfgsxj/4/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With