I'm trying to play this Dribble "example", though I'm not achieving. My current progress is this (using SCSS), however as it turns out I duplicated the background to achieve this effect, so that the images are aligned exactly one on top of the other I had to use background-position: center;
which is not what I wanted (I would use the cover property). How can I make this "effect" using only a background image?
Compiling SCSS for CSS, it looks like this:
* {
margin: 0;
padding: 0px;
}
#container {
box-shadow: 0 0 10px #202020;
width: 800px;
height: 280px;
margin: 20px auto;
background-image: url(https://thumbs.dreamstime.com/b/usa-new-york-panorama-sunrise-71107239.jpg);
background-repeat: no-repeat;
background-size: auto;
background-position: center;
background-color: darkslategray;
background-blend-mode: overlay;
display: flex;
justify-content: center;
align-items: center;
}
#main {
background-color: #fff;
background-image: url(https://thumbs.dreamstime.com/b/usa-new-york-panorama-sunrise-71107239.jpg);
background-repeat: no-repeat;
background-size: auto;
background-position: center;
border-radius: 10px;
width: 80%;
height: 80%;
}
<div id="container">
<div id="main">
</div>
</div>