I need the image to always be perfectly centered at the bottom of the blue background, regardless of window size changes. It should resemble this example: https://i.sstatic.net/FoX4D.jpg
One workaround could be to use top:37v;, although this method can cause the image to lose its positioning relative to the background when the window height is adjusted.
.background{
background-image: url("https://i.imgur.com/5Y5F5fF.png");
background-repeat: no-repeat;
background-size: cover;
background-position: 0 100%;
height: 50vh;
}
header img{
position: relative;
height: 100px;
/*!*top: 37vh;*! Don't want to use this as resizing will effect its position relative to background*/
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<header>
<div class="container-fluid d-flex justify-content-center background">
<img src="https://i.imgur.com/3dzn4KM.png" alt="phone">
</div>
</header>