Although the question involves the use of overlapping images, the actual scenario, if I interpret it correctly, should have an image and a filled container side by side. The image used is the one with little transparency at the bottom. Therefore, while our eyes can tell the difference, for the browser this is just an image.
Since you want the height of the container next to the image = to be with the height of the image - the height of the transparent / white area.
There are several ways to achieve this.
1) Using 2 separate images:
The part that looks like overlapping may be another image with absolute positioning with a z-index larger than the background image element. The background image element and the next full container can have the same height.
2) If we have a fixed height for the image, then for this particular case we can use 86% of the image height for the other half. This will create the same illusion. 86%, because the background is completely covered 86% of the entire image. Yes, I measured the pixel ratio using GIMP.
This particular case is more about the size of the image you are using, rather than some programming skills. Although what you are looking for can be achieved. To reproduce what I created this responsive solution in codepen .
.wrapper { max-width: 1200px; margin: 0 auto; } .hero-img { background-image: url(http://i.imgur.com/CkwLRd0.jpg); background-size: cover; background-position: bottom; background-repeat: no-repeat; width: 100%; height: 100%; } .banner { display: flex; } .half { width: 50%; height: 400px; } .red { background: indianred; } .text-holder { height: 86%; } <div class="wrapper"> <div class="banner"> <div class="half"> <div class="hero-img"></div> </div> <div class="half"> <div class="red text-holder"></div> </div> </div> </div>
Note that the wrapper is set to max-width: 1200px due to the relative size of the image used.
Let me know if your problem has been resolved or if you need more help.
Dibyanshu
source share