I am using bootstrap with some simple code. Inside the jumbotron div/container i have 2 images. One aligned left. One aligned right. How do i allow the right image to float over/above the left one on resize of the browser window? Driving me crazy.
<div class="jumbotron">
<div class="container">
<div class="left-image">
<img src="left-image.png">
</div>
<div class="right-image">
<img src="right-image.png">
</div>
</div>
</div>
I thought simple css like this would do it?
.left-image {
float: left;
}
.right-image {
float: right;
z-index: 999;
}
You need to use position: absolute if you want your images to overlap
.left-image{
position: absolute;
left: 200px;
}
.right-image{
position: absolute;
right: 200px;
z-index: 5;
}
Edit the left and right properties above to get the positioning to your liking.
Example
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