2
I’m trying to reproduce this "example" of Dribble, however I’m not getting it. My current progress is this (using SCSS), however as can be verified I duplicated the background to achieve this effect, for the images to be aligned exactly one on top of the other I had to use the background-position: center;
what is not the desired (I would like to use the property cover). How can I do this "effect" using only an image of background?
Compiling SCSS for CSS 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>
Thank you very much Hugo, it worked!
– Robison Aleixo