I came across this interesting code sample:
Snippet of CSS Code:
.container{width:100%;background:yellow;height:100vh;}
.top{
width:100%;
height: 60%;
position:absolute;
top:0;
background:url("http://bagel.dg-site.com/bagel/wp-content/uploads/2015/07/BANNER-300x215.png") no-repeat center center #B03D3D;
background-size:cover;
}
.left{
width: 50%;
height: 40%;
position:absolute;
bottom:0;
background:url("http://bagel.dg-site.com/bagel/wp-content/uploads/2015/07/NEWS2-300x246.png") no-repeat center center #B03D3D;
background-size: 100% 100%;
}
.right{
width: 50%;
height: 40%;
position:absolute;
bottom:0;
right:0;
background:url("http://bagel.dg-site.com/bagel/wp-content/uploads/2015/07/NEWS1-300x246.png") no-repeat center center #B03D3D;
background-size: 100% 100%;
}
<div class="container">
<div class="top"></div>
<div class="left"></div>
<div class="right"></div>
</div>
The issue is that the images below should always appear as squares, but when resizing the window they become rectangles.
Take a look at the image linked here:
It seems that all three images need to be square. Can you provide any insights on how to fix this problem?
Thank you in advance!